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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs