[clang] [C] Add -Wjump-bypasses-init (PR #138009)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri May 2 04:57:50 PDT 2025
================
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -fsyntax-only -verify=c,both -Wjump-bypasses-init %s
+// RUN: %clang_cc1 -fsyntax-only -verify=c,both -Wc++-compat %s
+// RUN: %clang_cc1 -fsyntax-only -verify=good %s
+// RUN: %clang_cc1 -fsyntax-only -verify=cxx,both -x c++ %s
+// good-no-diagnostics
+
+void goto_func_1(void) {
----------------
AaronBallman wrote:
We currently accept those in C++ the same as GCC: https://godbolt.org/z/f4ze65vWT but I'm not convinced that's a good behavior. I think those *should* be rejected in C++. And I think this patch actually makes us start to reject them, so good call!
https://github.com/llvm/llvm-project/pull/138009
More information about the cfe-commits
mailing list