Bug 3434 – +f(); should be an invalid statement.

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-10-22T07:53:00Z
Last change time
2015-06-09T01:26:55Z
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2009-10-22T07:53:58Z
As titled. The following code should cause a compile error. int f() { return 0; } void main () { // -f(); // Error: - has no effect in expression (-f()) +f(); // But this is valid... ? }
Comment #1 by yebblies — 2012-02-20T07:39:46Z
Why? It does _nothing_ and doesn't survive beyond semantic.
Comment #2 by andrej.mitrovich — 2013-02-04T18:24:35Z
I don't see the reason for it either, closing.