[clang] [C] Add -Wjump-bypasses-init (PR #138009)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu May 1 05:04:12 PDT 2025
================
@@ -560,13 +560,14 @@ LABEL3:{} // #GOTOLBL3
void IndirectGoto3_Loop() {
void* ptr;
#pragma acc parallel loop// #GOTOPAR_LOOP3
- for (unsigned i = 0; i < 5; ++i) {
+ for (unsigned i = 0; i < 5; ++i) { // #INIT
LABEL3:{} // #GOTOLBL3_2
ptr = &&LABEL3;
}
-// expected-error at +3{{cannot jump from this indirect goto statement to one of its possible targets}}
+// expected-error at +4{{cannot jump from this indirect goto statement to one of its possible targets}}
// expected-note@#GOTOLBL3_2{{possible target of indirect goto statement}}
// expected-note@#GOTOPAR_LOOP3{{invalid branch into OpenACC Compute/Combined Construct}}
+// expected-note@#INIT {{jump bypasses variable initialization}}
----------------
AaronBallman wrote:
Yup, I sure did, thank you!
https://github.com/llvm/llvm-project/pull/138009
More information about the cfe-commits
mailing list