136c22a23SDouglas Gregor // RUN: %clang_cc1 -fsyntax-only -verify %s 236c22a23SDouglas Gregor 336c22a23SDouglas Gregor // In addition, if class T has a user-declared constructor (12.1), 436c22a23SDouglas Gregor // every non-static data member of class T shall have a name different 536c22a23SDouglas Gregor // from T. 636c22a23SDouglas Gregor 736c22a23SDouglas Gregor struct X0 { 836c22a23SDouglas Gregor int X0; // okay 936c22a23SDouglas Gregor }; 1036c22a23SDouglas Gregor 1136c22a23SDouglas Gregor struct X1 { 12*715ee079SRichard Smith int X1; // expected-error{{member 'X1' has the same name as its class}} 13*715ee079SRichard Smith X1(); 1436c22a23SDouglas Gregor }; 1536c22a23SDouglas Gregor 1636c22a23SDouglas Gregor struct X2 { 1736c22a23SDouglas Gregor X2(); 1836c22a23SDouglas Gregor float X2; // expected-error{{member 'X2' has the same name as its class}} 1936c22a23SDouglas Gregor }; 20