summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/except/except.spec/p1.cpp9
-rw-r--r--clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp41
-rw-r--r--clang/test/SemaTemplate/instantiate-exception-spec.cpp21
3 files changed, 2 insertions, 69 deletions
diff --git a/clang/test/CXX/except/except.spec/p1.cpp b/clang/test/CXX/except/except.spec/p1.cpp
index fa53c9f5d23..a32f37d5520 100644
--- a/clang/test/CXX/except/except.spec/p1.cpp
+++ b/clang/test/CXX/except/except.spec/p1.cpp
@@ -77,12 +77,5 @@ namespace PR11084 {
static int f() noexcept(1/X) { return 10; } // expected-error{{argument to noexcept specifier must be a constant expression}} expected-note{{division by zero}}
};
- template<int X> void f() {
- int (*p)() noexcept(1/X); // expected-error{{argument to noexcept specifier must be a constant expression}} expected-note{{division by zero}}
- };
-
- void g() {
- A<0>::f(); // expected-note{{in instantiation of exception specification for 'f'}}
- f<0>(); // expected-note{{in instantiation of function template specialization}}
- }
+ void g() { A<0>::f(); } // expected-note{{in instantiation of exception specification for 'f' requested here}}
}
diff --git a/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp b/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
index f62ef61758a..a376f0e5fd5 100644
--- a/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
+++ b/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
@@ -58,13 +58,6 @@ namespace dr1330_example {
S().f<S>(); // ok
S().f<int>(); // expected-note {{instantiation of exception spec}}
}
-
- template<typename T>
- struct U {
- void f() noexcept(T::error);
- void (g)() noexcept(T::error);
- };
- U<int> uint; // ok
}
namespace core_19754_example {
@@ -144,37 +137,3 @@ namespace PR12763 {
};
void X::g() {} // expected-note {{in instantiation of}}
}
-
-namespace Variadic {
- template<bool B> void check() { static_assert(B, ""); }
- template<bool B, bool B2, bool ...Bs> void check() { static_assert(B, ""); check<B2, Bs...>(); }
-
- template<typename ...T> void consume(T...);
-
- template<typename ...T> void f(void (*...p)() throw (T)) {
- void (*q[])() = { p... };
- consume((p(),0)...);
- }
- template<bool ...B> void g(void (*...p)() noexcept (B)) {
- consume((p(),0)...);
- check<noexcept(p()) == B ...>();
- }
- template<typename ...T> void i() {
- consume([]() throw(T) {} ...);
- consume([]() noexcept(sizeof(T) == 4) {} ...);
- }
- template<bool ...B> void j() {
- consume([](void (*p)() noexcept(B)) {
- void (*q)() noexcept = p; // expected-error {{not superset of source}}
- } ...);
- }
-
- void z() {
- f<int, char, double>(nullptr, nullptr, nullptr);
- g<true, false, true>(nullptr, nullptr, nullptr);
- i<int, long, short>();
- j<true, true>();
- j<true, false>(); // expected-note {{in instantiation of}}
- }
-
-}
diff --git a/clang/test/SemaTemplate/instantiate-exception-spec.cpp b/clang/test/SemaTemplate/instantiate-exception-spec.cpp
index d3411722283..993ee8dfae1 100644
--- a/clang/test/SemaTemplate/instantiate-exception-spec.cpp
+++ b/clang/test/SemaTemplate/instantiate-exception-spec.cpp
@@ -1,7 +1,5 @@
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -verify %s -DERRORS
-// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -emit-llvm-only %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
-#ifdef ERRORS
template<typename T> void f1(T*) throw(T); // expected-error{{incomplete type 'Incomplete' is not allowed in exception specification}}
struct Incomplete; // expected-note{{forward}}
@@ -9,20 +7,3 @@ void test_f1(Incomplete *incomplete_p, int *int_p) {
f1(int_p);
f1(incomplete_p); // expected-note{{instantiation of}}
}
-#endif
-
-template<typename T> void f(void (*p)() throw(T)) {
-#ifdef ERRORS
- void (*q)() throw(char) = p; // expected-error {{target exception spec}}
-
- extern void (*p2)() throw(T);
- void (*q2)() throw(char) = p2; // expected-error {{target exception spec}}
-
- extern void (*p3)() throw(char);
- void (*q3)() throw(T) = p3; // expected-error {{target exception spec}}
-
- void (*q4)() throw(T) = p2; // ok
-#endif
- p();
-}
-void g() { f<int>(0); } // expected-note {{instantiation of}}
OpenPOWER on IntegriCloud