[LLVMbugs] [Bug 17397] New: Poor diagnostics for missing semicolon before typedef

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 28 11:33:51 PDT 2013


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

            Bug ID: 17397
           Summary: Poor diagnostics for missing semicolon before typedef
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cnweaver at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This is another case which seems similar to bugs 11424 and 11980, but not
identical. 

For a snippet like:

struct foo{};
struct bar{} //missing semicolon

typedef foo baz;

The diagnostics generated are:

missing_semi_before_typedef.cpp:4:9: error: typedef redefinition with different
types ('struct bar' vs 'foo')
typedef foo baz;
        ^
missing_semi_before_typedef.cpp:1:8: note: previous definition is here
struct foo{};
       ^
missing_semi_before_typedef.cpp:4:12: error: expected ';' after top level
declarator
typedef foo baz;
           ^
           ;
2 errors generated.

When something more like

missing_semi_before_typedef.cpp:2:13: error: expected ';' after struct
struct bar{} //missing semicolon
            ^
            ;
1 error generated.

would be preferable (and is exactly what is generated when the line containing
the typedef is not present).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130928/0d6bb333/attachment.html>


More information about the llvm-bugs mailing list