summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/exception-spec.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-05-29 18:02:33 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-05-29 18:02:33 +0000
commitd643456d450adf341f97a96c59608263eb160f09 (patch)
tree1d77735240d3a8a3e78232aad94623f25dc96b8b /clang/test/SemaCXX/exception-spec.cpp
parent9d809cad50204aa4358dac5439d81429b817c778 (diff)
downloadbcm5719-llvm-d643456d450adf341f97a96c59608263eb160f09.tar.gz
bcm5719-llvm-d643456d450adf341f97a96c59608263eb160f09.zip
Reject incomplete types in exception specs.
llvm-svn: 72580
Diffstat (limited to 'clang/test/SemaCXX/exception-spec.cpp')
-rw-r--r--clang/test/SemaCXX/exception-spec.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/exception-spec.cpp b/clang/test/SemaCXX/exception-spec.cpp
index d697e023554..a797dba1d22 100644
--- a/clang/test/SemaCXX/exception-spec.cpp
+++ b/clang/test/SemaCXX/exception-spec.cpp
@@ -23,3 +23,13 @@ void (**k)(void pfa() throw(int)); // no-error
void (**j)() throw(int); // expected-error {{not allowed beyond a single}}
// Pointer to function returning pointer to pointer to function with spec
void (**(*h())())() throw(int); // expected-error {{not allowed beyond a single}}
+
+struct Incomplete;
+
+// Exception spec must not have incomplete types, or pointers to them, except
+// void.
+void ic1() throw(void); // expected-error {{incomplete type 'void' is not allowed in exception specification}}
+void ic2() throw(Incomplete); // expected-error {{incomplete type 'struct Incomplete' is not allowed in exception specification}}
+void ic3() throw(void*);
+void ic4() throw(Incomplete*); // expected-error {{pointer to incomplete type 'struct Incomplete' is not allowed in exception specification}}
+void ic5() throw(Incomplete&); // expected-error {{reference to incomplete type 'struct Incomplete' is not allowed in exception specification}}
OpenPOWER on IntegriCloud