summaryrefslogtreecommitdiff
path: root/test/SemaCXX/exceptions.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-05-04 16:12:48 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-05-04 16:12:48 +0000
commit0883ccd9eac3b974df00e6548ee319a7dd3646f4 (patch)
treed6a70c3518b8dea8be7062438d7e8676820ed17f /test/SemaCXX/exceptions.cpp
parent60bfabcd8ce617297c0d231f77d14ab507e98796 (diff)
Notes
Diffstat (limited to 'test/SemaCXX/exceptions.cpp')
-rw-r--r--test/SemaCXX/exceptions.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/exceptions.cpp b/test/SemaCXX/exceptions.cpp
index 2ed4bfe885623..18349d10ef71c 100644
--- a/test/SemaCXX/exceptions.cpp
+++ b/test/SemaCXX/exceptions.cpp
@@ -97,3 +97,26 @@ BadReturn::BadReturn(int) try {
}
}
}
+
+// Cannot throw an abstract type.
+class foo {
+public:
+ foo() {}
+ void bar () {
+ throw *this; // expected-error{{cannot throw an object of abstract type 'foo'}}
+ }
+ virtual void test () = 0; // expected-note{{pure virtual function 'test'}}
+};
+
+namespace PR6831 {
+ namespace NA { struct S; }
+ namespace NB { struct S; }
+
+ void f() {
+ using namespace NA;
+ using namespace NB;
+ try {
+ } catch (int S) {
+ }
+ }
+}