================
@@ -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:

These are fun examples. It turns out that this code is accepted in both C and 
C++ despite jumping over the initialization, in both Clang and GCC. I'm not 
convinced that's a good design, but I don't think this patch changes the 
behavior either, and so I don't think we should diagnose. However, perhaps we 
should in a follow-up, so I've filed: 
https://github.com/llvm/llvm-project/issues/138257 and added these as negative 
tests for this PR.

https://github.com/llvm/llvm-project/pull/138009
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to