From 37d341d1f0d786e0df31a6983a80cf96c30d5faf Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 12 Jul 2018 21:11:25 +0000 Subject: PR38141: check whether noexcept-specifications are equivalent in redeclarations git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336946 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CXX/except/except.spec/p3.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/CXX') diff --git a/test/CXX/except/except.spec/p3.cpp b/test/CXX/except/except.spec/p3.cpp index 03f1d7626c..d5af465104 100644 --- a/test/CXX/except/except.spec/p3.cpp +++ b/test/CXX/except/except.spec/p3.cpp @@ -104,3 +104,13 @@ void* operator new(mysize_t); void* operator new[](mysize_t); void* operator new[](mysize_t) throw(std::bad_alloc); +template void equivalent() noexcept (X); +template void equivalent() noexcept (X); + +template void not_equivalent() noexcept (X); // expected-note {{previous}} +template void not_equivalent() noexcept (Y); // expected-error {{does not match}} + +template void missing() noexcept (X); // expected-note {{previous}} +// FIXME: The missing exception specification that we report here doesn't make +// sense in the context of this declaration. +template void missing(); // expected-error {{missing exception specification 'noexcept(X)'}} -- cgit v1.2.1