[LLVMbugs] [Bug 13596] New: Recover better from missing closing braces

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 13 11:08:37 PDT 2012


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

             Bug #: 13596
           Summary: Recover better from missing closing braces
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Nicos-MacBook-Pro:src thakis$ cat test.cc
bool f(bool b) {
  if (b) {
    ;
}

void g(int i, int j) {
}
Nicos-MacBook-Pro:src thakis$ third_party/llvm-build/Release+Asserts/bin/clang
-c test.cc
test.cc:6:21: error: expected ';' at end of declaration
void g(int i, int j) {
                    ^
                    ;
test.cc:7:2: error: expected '}'
}
 ^
test.cc:1:16: note: to match this '{'
bool f(bool b) {
               ^
2 errors generated.


If clang sees a "{" after a function declaration, chances are that before that
decl a closing brace is missing. clang should error on that and then proceed if
it was there.

(bug 7555 is somewhat related)

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