[LLVMbugs] [Bug 4846] New: Diagnostics for declaration typos can be terrible, and are in any case inconsistent

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Aug 31 21:54:50 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4846

           Summary: Diagnostics for declaration typos can be terrible, and
                    are in any case inconsistent
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rideau3 at gmail.com
                CC: llvmbugs at cs.uiuc.edu


At global scope, the following declaration (a common typo) gives a nasty error:

sturct foo { };

If the same declaration is made in function scope:

void bar () { sturct foo { }; }

then the second error disappears. This is inconsistent. Furthermore, the same
error is encountered if the function argument parentheses are accidentally
omitted at global scope, or with "int foo :", which could be a label or (in
C++) a base specifier.

The error message should be consistent between the two scopes, and, if the
"invalid token" message is retained, it should probably disambiguate for some
of the common misspellings.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list