diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-09-16 23:15:32 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-09-16 23:15:32 +0000 |
commit | 2f55019bf0f229d5b66938618497ade2c35091ee (patch) | |
tree | ba54ab0d7bf1cbf6713f33fa89d868108464626f /clang/test/SemaCXX/MicrosoftExtensions.cpp | |
parent | 09a9b6b953a969a0b89f1d08ae14878c0689b00e (diff) | |
download | bcm5719-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.cpp | 16 |
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; +} } |