aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx0x-defaulted-functions.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-01-16 23:39:10 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-01-16 23:39:10 +0000
commitafb7ce3f877594362381926eaeac8ed6bbe18069 (patch)
tree7a3c344bbed5830c48e783dee6012eefa2939ae8 /test/SemaCXX/cxx0x-defaulted-functions.cpp
parent2df0df8de44845a441f07a37db5bfcadd0215019 (diff)
Fixes crash when illegal function definitions are deleted or defaulted. Fixes PR14577.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx0x-defaulted-functions.cpp')
-rw-r--r--test/SemaCXX/cxx0x-defaulted-functions.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-defaulted-functions.cpp b/test/SemaCXX/cxx0x-defaulted-functions.cpp
index ce7ee672ea..3ad3a447f8 100644
--- a/test/SemaCXX/cxx0x-defaulted-functions.cpp
+++ b/test/SemaCXX/cxx0x-defaulted-functions.cpp
@@ -149,3 +149,24 @@ namespace PR13527 {
Y &Y::operator=(Y&&) = default; // expected-error {{definition of explicitly defaulted}}
Y::~Y() = default; // expected-error {{definition of explicitly defaulted}}
}
+
+namespace PR14577 {
+ template<typename T>
+ struct Outer {
+ template<typename U>
+ struct Inner1 {
+ ~Inner1();
+ };
+
+ template<typename U>
+ struct Inner2 {
+ ~Inner2();
+ };
+ };
+
+ template<typename T>
+ Outer<T>::Inner1<T>::~Inner1() = delete; // expected-error {{nested name specifier 'Outer<T>::Inner1<T>::' for declaration does not refer into a class, class template or class template partial specialization}} expected-error {{only functions can have deleted definitions}}
+
+ template<typename T>
+ Outer<T>::Inner2<T>::~Inner2() = default; // expected-error {{nested name specifier 'Outer<T>::Inner2<T>::' for declaration does not refer into a class, class template or class template partial specialization}} expected-error {{only special member functions may be defaulted}}
+}