summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class/class.mem
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-04-16 18:27:27 +0000
committerDouglas Gregor <dgregor@apple.com>2012-04-16 18:27:27 +0000
commit433e05306fa0217598535211103641221b9021ce (patch)
tree3529a26e1b3685172e00a8aabb16dc5d4543d998 /clang/test/CXX/class/class.mem
parent505a7c818d9686f8044ce83c6de9e8c234af9f98 (diff)
downloadbcm5719-llvm-433e05306fa0217598535211103641221b9021ce.tar.gz
bcm5719-llvm-433e05306fa0217598535211103641221b9021ce.zip
Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a member function to throw an instance of its own class. Fixes PR12564 and a fairly embarassing oversight in our C++98/03 support. llvm-svn: 154844
Diffstat (limited to 'clang/test/CXX/class/class.mem')
-rw-r--r--clang/test/CXX/class/class.mem/p2.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/CXX/class/class.mem/p2.cpp b/clang/test/CXX/class/class.mem/p2.cpp
index 09040d859c8..0a823f4c1f0 100644
--- a/clang/test/CXX/class/class.mem/p2.cpp
+++ b/clang/test/CXX/class/class.mem/p2.cpp
@@ -29,3 +29,30 @@ namespace test2 {
A<int> x;
};
}
+
+namespace test3 {
+ struct A {
+ struct B {
+ void f() throw(A);
+ void g() throw(B);
+ };
+
+ void f() throw(A);
+ void g() throw(B);
+ };
+
+ template<typename T>
+ struct A2 {
+ struct B {
+ void f1() throw(A2);
+ void f2() throw(A2<T>);
+ void g() throw(B);
+ };
+
+ void f1() throw(A2);
+ void f2() throw(A2<T>);
+ void g() throw(B);
+ };
+
+ template struct A2<int>;
+}
OpenPOWER on IntegriCloud