[LLVMbugs] [Bug 17920] New: goto label at end of function fails to compile...

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 13 15:57:43 PST 2013


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

            Bug ID: 17920
           Summary: goto label at end of function fails to compile...
           Product: clang
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sean at chittenden.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

It appears like the grammar parser is expecting a statement after a goto label.

% clang++ -std=c++11 -stdlib=libc++ -Wall -pedantic -Werror foo2.cpp
foo2.cpp:4:1: error: expected statement
}
^
1 error generated.
% cat foo2.cpp
int main() {
  goto end;
  end:
}

Changing main() to include a return or even the noop "(void)0;" after the label
"end:" fixes the compilation.

-- 
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/20131113/06c93157/attachment.html>


More information about the llvm-bugs mailing list