summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/exceptions.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-04-27 21:03:30 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-04-27 21:03:30 +0000
commit2f38ba57c84f4207ebf171e213e42e342b939b57 (patch)
treee01f8072a90cc16e537811045eba12132747e501 /clang/test/SemaCXX/exceptions.cpp
parent27b4f222cf30141080fb6a69496b0155f152268c (diff)
downloadbcm5719-llvm-2f38ba57c84f4207ebf171e213e42e342b939b57.tar.gz
bcm5719-llvm-2f38ba57c84f4207ebf171e213e42e342b939b57.zip
Don't allow catch declarations to name an abstract class
llvm-svn: 70248
Diffstat (limited to 'clang/test/SemaCXX/exceptions.cpp')
-rw-r--r--clang/test/SemaCXX/exceptions.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/exceptions.cpp b/clang/test/SemaCXX/exceptions.cpp
index 508f23d148e..42973eba70e 100644
--- a/clang/test/SemaCXX/exceptions.cpp
+++ b/clang/test/SemaCXX/exceptions.cpp
@@ -2,6 +2,8 @@
struct A; // expected-note 4 {{forward declaration of 'struct A'}}
+struct Abstract { virtual void f() = 0; }; // expected-note {{pure virtual function 'f'}}
+
void trys() {
try {
} catch(int i) { // expected-note {{previous definition}}
@@ -12,6 +14,7 @@ void trys() {
} catch(A a) { // expected-error {{cannot catch incomplete type 'struct A'}}
} catch(A *a) { // expected-error {{cannot catch pointer to incomplete type 'struct A'}}
} catch(A &a) { // expected-error {{cannot catch reference to incomplete type 'struct A'}}
+ } catch(Abstract) { // expected-error {{variable type 'Abstract' is an abstract class}}
} catch(...) {
int j = i; // expected-error {{use of undeclared identifier 'i'}}
}
OpenPOWER on IntegriCloud