summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-09-16 23:15:32 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-09-16 23:15:32 +0000
commit2f55019bf0f229d5b66938618497ade2c35091ee (patch)
treeba54ab0d7bf1cbf6713f33fa89d868108464626f /clang/test/SemaCXX/MicrosoftExtensions.cpp
parent09a9b6b953a969a0b89f1d08ae14878c0689b00e (diff)
downloadbcm5719-llvm-2f55019bf0f229d5b66938618497ade2c35091ee.tar.gz
bcm5719-llvm-2f55019bf0f229d5b66938618497ade2c35091ee.zip
In Microsoft mode, warn if an indirect goto jump over a variable initialization.
Also add a test case for the non Microsoft case because such test didn't exist. llvm-svn: 139971
Diffstat (limited to 'clang/test/SemaCXX/MicrosoftExtensions.cpp')
-rw-r--r--clang/test/SemaCXX/MicrosoftExtensions.cpp16
1 files changed, 8 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;
+}
}
OpenPOWER on IntegriCloud