Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.
This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.
This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169667 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/anonymous-struct.cpp b/test/SemaCXX/anonymous-struct.cpp
index 19a88d7..8a61041 100644
--- a/test/SemaCXX/anonymous-struct.cpp
+++ b/test/SemaCXX/anonymous-struct.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct S {
- S(); // expected-note {{because type 'S' has a user-declared constructor}}
+ S(); // expected-note {{because type 'S' has a user-provided default constructor}}
};
struct { // expected-error {{anonymous structs and classes must be class members}}
@@ -9,7 +9,7 @@
struct E {
struct {
- S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}}
+ S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}}
};
static struct {
};