diff options
Diffstat (limited to 'test/SemaCXX/statements.cpp')
-rw-r--r-- | test/SemaCXX/statements.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/SemaCXX/statements.cpp b/test/SemaCXX/statements.cpp index 3698258..852086e 100644 --- a/test/SemaCXX/statements.cpp +++ b/test/SemaCXX/statements.cpp @@ -1,5 +1,17 @@ -// RUN: %clang_cc1 %s -fsyntax-only -pedantic +// RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify void foo() { return foo(); } + +// PR6451 - C++ Jump checking +struct X { + X(); +}; + +void test2() { + goto later; // expected-error {{illegal goto into protected scope}} + X x; // expected-note {{jump bypasses variable initialization}} +later: + ; +} |