summaryrefslogtreecommitdiffstats
path: root/test/CXX/special
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-11-15 22:39:08 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-11-15 22:39:08 +0000
commit3bc451593fa44bfc45753e44e37cb4242e714f82 (patch)
tree2d71a64b8832a6d3dc95d8dd08991578fd8596d3 /test/CXX/special
parentb8691df825c99b0fc989fcd92a008d2500ff2e37 (diff)
Compute whether a class is trivial correctly for template classes with an explicitly deleted or defaulted special member. PR11387.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/special')
-rw-r--r--test/CXX/special/class.ctor/p5-0x.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/CXX/special/class.ctor/p5-0x.cpp b/test/CXX/special/class.ctor/p5-0x.cpp
index c8d206ae37..00c25e8e3a 100644
--- a/test/CXX/special/class.ctor/p5-0x.cpp
+++ b/test/CXX/special/class.ctor/p5-0x.cpp
@@ -157,7 +157,14 @@ static_assert(!__has_trivial_constructor(NonTrivialDefCtor6), "NonTrivialDefCtor
// Otherwise, the default constructor is non-trivial.
class Trivial2 { Trivial2() = delete; };
-static_assert(__has_trivial_constructor(Trivial2), "NonTrivialDefCtor2 is trivial");
+static_assert(__has_trivial_constructor(Trivial2), "Trivial2 is trivial");
class Trivial3 { Trivial3() = default; };
-static_assert(__has_trivial_constructor(Trivial3), "NonTrivialDefCtor3 is trivial");
+static_assert(__has_trivial_constructor(Trivial3), "Trivial3 is trivial");
+
+template<typename T> class Trivial4 { Trivial4() = default; };
+static_assert(__has_trivial_constructor(Trivial4<int>), "Trivial4 is trivial");
+
+template<typename T> class Trivial5 { Trivial5() = delete; };
+static_assert(__has_trivial_constructor(Trivial5<int>), "Trivial5 is trivial");
+