summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-07 20:56:01 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-07 20:56:01 +0000
commit5d1b4e3d1f63a7761337cfc4535eb10d5ee3ec4a (patch)
tree6f75dadf4870230820e1f48deb2d30fc04ccb9d9 /clang/test/CXX/class
parent7f076cb6cc537a1ef77bf2a16549394f03605d33 (diff)
downloadbcm5719-llvm-5d1b4e3d1f63a7761337cfc4535eb10d5ee3ec4a.tar.gz
bcm5719-llvm-5d1b4e3d1f63a7761337cfc4535eb10d5ee3ec4a.zip
When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the initial declaration. Previously, we would wait until later to handle default/delete as a definition, but this is too late: when adding the declaration, we already treated the declaration as "user-provided" when in fact it was merely "user-declared". Fixes PR10861 and PR10442, along with a bunch of FIXMEs. llvm-svn: 144011
Diffstat (limited to 'clang/test/CXX/class')
-rw-r--r--clang/test/CXX/class/p6-0x.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CXX/class/p6-0x.cpp b/clang/test/CXX/class/p6-0x.cpp
index 3384af09c78..f2cf4828211 100644
--- a/clang/test/CXX/class/p6-0x.cpp
+++ b/clang/test/CXX/class/p6-0x.cpp
@@ -13,3 +13,18 @@ static_assert(!__is_trivial(NonTrivial2), "NonTrivial2 is trivial");
static_assert(!__is_trivial(NonTrivial3), "NonTrivial3 is trivial");
static_assert(!__is_trivial(NonTrivial4), "NonTrivial4 is trivial");
static_assert(!__is_trivial(NonTrivial5), "NonTrivial5 is trivial");
+
+struct Trivial2 {
+ Trivial2() = default;
+ Trivial2(const Trivial2 &) = default;
+ Trivial2(Trivial2 &&) = default;
+ Trivial2 &operator=(const Trivial2 &) = default;
+ Trivial2 &operator=(Trivial2 &) = default;
+ ~Trivial2() = default;
+};
+
+class NonTrivial6 { ~NonTrivial6(); };
+
+NonTrivial6::~NonTrivial6() = default;
+
+static_assert(!__is_trivial(NonTrivial6), "NonTrivial6 is trivial");
OpenPOWER on IntegriCloud