4711 – Incorrect handling of && operator with void operand

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4711 - Incorrect handling of && operator with void operand
Summary: Incorrect handling of && operator with void operand
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
Reported: 2010年08月22日 02:51 UTC by Ersin Er
Modified: 2011年12月28日 10:26 UTC (History)
3 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Ersin Er 2010年08月22日 02:51:37 UTC
The following code compiles and outputs "1 = 1" as expected when executed:
 1 == 1 && writeln("1 = 1");
However, the following code fails to compile (although it should not):
 1 == 2 && writeln("1 = 2");
The compiler error is as follows:
 Error: integral constant must be scalar type, not void
Comment 1 Brad Roberts 2011年02月06日 15:40:27 UTC
Mass migration of bugs marked as x86-64 to just x86. The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.


AltStyle によって変換されたページ (->オリジナル) /