PR10217: Provide diagnostics explaining why an implicitly-deleted special
member function is deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153773 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/cxx0x-deleted-default-ctor.cpp b/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
index f6e5593..a5eaa35 100644
--- a/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
+++ b/test/SemaCXX/cxx0x-deleted-default-ctor.cpp
@@ -7,23 +7,23 @@
   ~non_trivial();
 };
 
-union bad_union { // expected-note {{defined here}}
-  non_trivial nt;
+union bad_union {
+  non_trivial nt; // expected-note {{non-trivial default constructor}}
 };
 bad_union u; // expected-error {{call to implicitly-deleted default constructor}}
-union bad_union2 { // expected-note {{defined here}}
+union bad_union2 { // expected-note {{all data members are const-qualified}}
   const int i;
 };
 bad_union2 u2; // expected-error {{call to implicitly-deleted default constructor}}
 
-struct bad_anon { // expected-note {{defined here}}
+struct bad_anon {
   union {
-    non_trivial nt;
+    non_trivial nt; // expected-note {{non-trivial default constructor}}
   };
 };
 bad_anon a; // expected-error {{call to implicitly-deleted default constructor}}
-struct bad_anon2 { // expected-note {{defined here}}
-  union {
+struct bad_anon2 {
+  union { // expected-note {{all data members of an anonymous union member are const-qualified}}
     const int i;
   };
 };
@@ -48,8 +48,8 @@
 };
 good g;
 
-struct bad_const { // expected-note {{defined here}}
-  const good g;
+struct bad_const {
+  const good g; // expected-note {{field 'g' of const-qualified type 'const good' would not be initialized}}
 };
 bad_const bc; // expected-error {{call to implicitly-deleted default constructor}}
 
@@ -59,25 +59,25 @@
 good_const gc;
 
 struct no_default {
-  no_default() = delete;
+  no_default() = delete; // expected-note 2{{deleted here}}
 };
 struct no_dtor {
-  ~no_dtor() = delete;
+  ~no_dtor() = delete; // expected-note 2{{deleted here}}
 };
 
-struct bad_field_default { // expected-note {{defined here}}
-  no_default nd;
+struct bad_field_default {
+  no_default nd; // expected-note {{field 'nd' has a deleted default constructor}}
 };
 bad_field_default bfd; // expected-error {{call to implicitly-deleted default constructor}}
-struct bad_base_default : no_default { // expected-note {{defined here}}
+struct bad_base_default : no_default { // expected-note {{base class 'no_default' has a deleted default constructor}}
 };
 bad_base_default bbd; // expected-error {{call to implicitly-deleted default constructor}}
 
-struct bad_field_dtor { // expected-note {{defined here}}
-  no_dtor nd;
+struct bad_field_dtor {
+  no_dtor nd; // expected-note {{field 'nd' has a deleted destructor}}
 };
 bad_field_dtor bfx; // expected-error {{call to implicitly-deleted default constructor}}
-struct bad_base_dtor : no_dtor { // expected-note {{defined here}}
+struct bad_base_dtor : no_dtor { // expected-note {{base class 'no_dtor' has a deleted destructor}}
 };
 bad_base_dtor bbx; // expected-error {{call to implicitly-deleted default constructor}}
 
@@ -85,16 +85,16 @@
   ambiguous_default();
   ambiguous_default(int = 2);
 };
-struct has_amb_field { // expected-note {{defined here}}
-  ambiguous_default ad;
+struct has_amb_field {
+  ambiguous_default ad; // expected-note {{field 'ad' has multiple default constructors}}
 };
 has_amb_field haf; // expected-error {{call to implicitly-deleted default constructor}}
 
 class inaccessible_default {
   inaccessible_default();
 };
-struct has_inacc_field { // expected-note {{defined here}}
-  inaccessible_default id;
+struct has_inacc_field {
+  inaccessible_default id; // expected-note {{field 'id' has an inaccessible default constructor}}
 };
 has_inacc_field hif; // expected-error {{call to implicitly-deleted default constructor}}
 
@@ -107,9 +107,9 @@
 };
 has_friend hf;
 
-struct defaulted_delete { // expected-note {{defined here}}
+struct defaulted_delete {
   no_default nd;
-  defaulted_delete() = default; // expected-note{{declared here}}
+  defaulted_delete() = default; // expected-note{{deleted here}}
 };
 defaulted_delete dd; // expected-error {{call to implicitly-deleted default constructor}}