The diagnostic format was invalid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278487
91177308-0d34-0410-b5e6-
96231b3b80d8
def err_decomp_decl_non_public_member : Error<
"cannot decompose non-public member %0 of %1">;
def err_decomp_decl_anon_union_member : Error<
- "cannot decompose class type %1 because it has an anonymous "
- "%select{struct|union} member">;
+ "cannot decompose class type %0 because it has an anonymous "
+ "%select{struct|union}1 member">;
def err_decomp_decl_std_tuple_element_not_specialized : Error<
"cannot decompose this type; 'std::tuple_element<%0>::type' "
"does not name a type">;
}
}
+namespace AnonymousMember {
+ struct Struct {
+ struct { // expected-note {{declared here}}
+ int i;
+ };
+ };
+
+ struct Union {
+ union { // expected-note {{declared here}}
+ int i;
+ };
+ };
+
+ void test() {
+ auto [a1] = Struct(); // expected-error {{cannot decompose class type 'AnonymousMember::Struct' because it has an anonymous struct member}}
+ auto [a2] = Union(); // expected-error {{cannot decompose class type 'AnonymousMember::Union' because it has an anonymous union member}}
+ }
+}
+
namespace MultipleClasses {
struct B : A {
int a;