[Issue 7601] New: Spurious "dangling else" warning with "version(X):"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 27 12:07:42 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7601

           Summary: Spurious "dangling else" warning with "version(X):"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2012-02-27 12:07:40 PST ---
-----------------
version(D_Version2):

version(DigitalMars)
    const DEFAULT_COMPILER = "dmd";
else
    const DEFAULT_COMPILER = "gdmd";
-----------------

Above code gives the following warning (compile with -w):

test.d(5): Warning: else is dangling, add { } after condition at test.d(1)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list