summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-03-27 00:22:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-03-27 00:22:47 +0000
commit3901dfe431a87c71592293f579a0ec74633e1ea9 (patch)
treed2f4da849dbfb0077f22eabdfbce646db29a1fc1 /clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
parentecafbe60384fa51f6a5188fd0bfaeb2a56273771 (diff)
downloadbcm5719-llvm-3901dfe431a87c71592293f579a0ec74633e1ea9.tar.gz
bcm5719-llvm-3901dfe431a87c71592293f579a0ec74633e1ea9.zip
PR15597: Fix a confusion between the implicit exception specification and the
uninstantiated exception specification when a special member within a class template is both defaulted and given an exception specification on its first declaration. llvm-svn: 178103
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-defaulted-functions.cpp')
-rw-r--r--clang/test/SemaCXX/cxx0x-defaulted-functions.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp b/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
index 3ba03c4eee2..bc03bcd2a13 100644
--- a/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
+++ b/clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -fcxx-exceptions %s
void fn() = default; // expected-error {{only special member}}
struct foo {
@@ -175,3 +175,16 @@ extern "C" {
template<typename _Tp> // expected-error {{templates must have C++ linkage}}
void PR13573(const _Tp&) = delete; // expected-error {{only functions can have deleted definitions}}
}
+
+namespace PR15597 {
+ template<typename T> struct A {
+ A() noexcept(true) = default;
+ ~A() noexcept(true) = default;
+ };
+ template<typename T> struct B {
+ B() noexcept(false) = default; // expected-error {{does not match the calculated one}}
+ ~B() noexcept(false) = default; // expected-error {{does not match the calculated one}}
+ };
+ A<int> a;
+ B<int> b; // expected-note {{here}}
+}
OpenPOWER on IntegriCloud