diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaCXX/cxx0x-defaulted-functions.cpp | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/SemaCXX/cxx0x-defaulted-functions.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-defaulted-functions.cpp | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/test/SemaCXX/cxx0x-defaulted-functions.cpp b/test/SemaCXX/cxx0x-defaulted-functions.cpp index ce7ee67..bc03bcd 100644 --- a/test/SemaCXX/cxx0x-defaulted-functions.cpp +++ b/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 { @@ -149,3 +149,42 @@ 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}} +} + +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}} +} |