diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/MicrosoftExtensions.cpp | 16 | ||||
-rw-r--r-- | clang/test/SemaCXX/scope-check.cpp | 15 |
2 files changed, 23 insertions, 8 deletions
diff --git a/clang/test/SemaCXX/MicrosoftExtensions.cpp b/clang/test/SemaCXX/MicrosoftExtensions.cpp index d92eda711cb..396ee13f66a 100644 --- a/clang/test/SemaCXX/MicrosoftExtensions.cpp +++ b/clang/test/SemaCXX/MicrosoftExtensions.cpp @@ -258,14 +258,6 @@ void f() } - - - - - - - - namespace ms_protected_scope { struct C { C(); }; @@ -305,6 +297,14 @@ void exception_jump() { } catch(int) { } } + +int jump_over_indirect_goto() { + static void *ps[] = { &&a0 }; + goto *&&a0; // expected-warning {{goto into protected scope}} + int a = 3; // expected-note {{jump bypasses variable initialization}} + a0: + return 0; +} } diff --git a/clang/test/SemaCXX/scope-check.cpp b/clang/test/SemaCXX/scope-check.cpp index d656a074db3..ec2f2e565fc 100644 --- a/clang/test/SemaCXX/scope-check.cpp +++ b/clang/test/SemaCXX/scope-check.cpp @@ -191,4 +191,19 @@ bool recurse() { break; } } + + +namespace test10 { +
+int test() {
+ static void *ps[] = { &&a0 };
+ goto *&&a0; // expected-error {{goto into protected scope}}
+ int a = 3; // expected-note {{jump bypasses variable initialization}}
+ a0:
+ return 0;
+} + } + +} + |