Implements part of paper P2324R2
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf
Fixes https://github.com/llvm/llvm-project/issues/61507
Details
- Reviewers
aaron.ballman cor3ntin
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
A big TODO: rename ext_c_label_end_of_compound_statement to something like ext_c_label_free_positioning. Since we found out it is more complete than just the end of statements.
clang/lib/Parse/ParseStmt.cpp | ||
---|---|---|
695–697 | Place in code where it matters: https://github.com/llvm/llvm-project/blob/84870c4abbacfb97ca025c9219b724f381611380/clang/lib/Parse/ParseStmt.cpp#L237 | |
clang/test/OpenMP/threadprivate_messages.cpp | ||
141 | TODO: find out if this is okay? (I've got no idea what it does) | |
clang/test/Parser/c2x-label.c | ||
5–6 | TODO: make sure a warning is printed. I couldn't find correct conditions for the warning, I tried and it produced false positive warnings in some other tests =( P.S. Its C++'s counterpart: https://github.com/llvm/llvm-project/blob/main/clang/test/Parser/cxx2b-label.cpp |
clang/lib/Parse/ParseStmt.cpp | ||
---|---|---|
745 | At this point, you know whether you've parsed a declaration statement or not, so you could potentially add the extension diagnostic logic here. | |
clang/test/OpenMP/threadprivate_messages.cpp | ||
141 | CC @mikerice @jyu2 @jdoerfert for opinions on OpenMP impact. There are FIXMEs in the code related to this: https://github.com/llvm/llvm-project/blob/main/clang/lib/Parse/ParseOpenMP.cpp#L2671 | |
clang/test/Parser/c2x-label.c | ||
5–6 | Yeah, this would be specific to C because C++ has always allowed a declaration there. I left a comment above with a potential idea. |
Place in code where it matters: https://github.com/llvm/llvm-project/blob/84870c4abbacfb97ca025c9219b724f381611380/clang/lib/Parse/ParseStmt.cpp#L237