[LLVMbugs] [Bug 11424] New: fails to report missing semicolon if followed by constructor decl

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 22 14:06:07 PST 2011


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

             Bug #: 11424
           Summary: fails to report missing semicolon if followed by
                    constructor decl
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This small snippet:

 class A {
   class B {
     int x;
   }  // <-- missing semicolon
   int i;
 };

is reported correctly by clang. However, if you write:

 class A {
   class B {
     int x;
   }
   A();
 };

then we instead spew:

test.cc:5:3: error: member 'A' has the same name as its class
 A() {}
 ^
test.cc:2:9: error: 'A::B' can not be defined in the result type of a function
 class B {
       ^
test.cc:5:3: error: constructor cannot have a return type
 A() {}
 ^
3 errors generated.

We should report the missing semicolon as we do in the other cases.

-- 
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