summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-exception-spec.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-08 17:45:32 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-08 17:45:32 +0000
commit0ae7b3f1d5403265f693ed75384603ca8fbba74d (patch)
tree5551031460d1b0cdb7ad8a752c21d21f239e265f /test/SemaTemplate/instantiate-exception-spec.cpp
parent7b682656310b0d7e94a98d982444bc7ddedc653f (diff)
downloadclang-0ae7b3f1d5403265f693ed75384603ca8fbba74d.tar.gz
Implement template instantiation for exception specifications. Also,
print exception specifications on function types and declarations. Fixes <rdar://problem/7450999>. There is some poor source-location information here, because we don't track locations of the types in exception specifications. Filed PR5719. Failures during template instantiation of the signature of a function or function template have wrong point-of-instantiation location information. I'll tackle that with a separate commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-exception-spec.cpp')
-rw-r--r--test/SemaTemplate/instantiate-exception-spec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-exception-spec.cpp b/test/SemaTemplate/instantiate-exception-spec.cpp
new file mode 100644
index 0000000000..31db4487a2
--- /dev/null
+++ b/test/SemaTemplate/instantiate-exception-spec.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// FIXME: the "note" should be down at the call site!
+template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'struct Incomplete' is not allowed in exception specification}} \
+ // expected-note{{instantiation of}}
+struct Incomplete; // expected-note{{forward}}
+
+void test_f1(Incomplete *incomplete_p, int *int_p) {
+ f1(int_p);
+ f1(incomplete_p);
+}