diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-15 18:34:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-15 18:34:13 +0000 |
commit | e6e422b1ee4f6a6530a54abc8f31afd2be2340c8 (patch) | |
tree | 8bfeedc63fa421638b9f61c7901c6ccf80468448 /clang/test/SemaCXX/scope-check.cpp | |
parent | a556848131d1e7210aa4e6e5724ba716a2bf5c13 (diff) | |
download | bcm5719-llvm-e6e422b1ee4f6a6530a54abc8f31afd2be2340c8.tar.gz bcm5719-llvm-e6e422b1ee4f6a6530a54abc8f31afd2be2340c8.zip |
When a statement is dropped from the AST because it was invalid, make sure
we don't do the scope checks otherwise we are going to hit assertion checks
since a label may not have been actually added.
llvm-svn: 175281
Diffstat (limited to 'clang/test/SemaCXX/scope-check.cpp')
-rw-r--r-- | clang/test/SemaCXX/scope-check.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/scope-check.cpp b/clang/test/SemaCXX/scope-check.cpp index 8fd23f4efe9..de276ae3d3d 100644 --- a/clang/test/SemaCXX/scope-check.cpp +++ b/clang/test/SemaCXX/scope-check.cpp @@ -274,3 +274,15 @@ namespace test15 { goto x; // expected-error {{goto into protected scope}} } } + +namespace test16 { +Invalid inv; // expected-error {{unknown type name}} +// Make sure this doesn't assert. +void fn() +{ + int c = 0; + if (inv) +Here: ; + goto Here; +} +} |