blob: 1b5dc13cea01542a56c2233b05418494debe1375 [file] [log] [blame]
Argyrios Kyrtzidisdd7744d2010-08-16 17:27:08 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3struct S {
Richard Smithac713512012-12-08 02:53:02 +00004 S(); // expected-note {{because type 'S' has a user-provided default constructor}}
Argyrios Kyrtzidisdd7744d2010-08-16 17:27:08 +00005};
6
David Blaikie2b79c322011-10-19 22:43:29 +00007struct { // expected-error {{anonymous structs and classes must be class members}}
8};
9
Argyrios Kyrtzidisdd7744d2010-08-16 17:27:08 +000010struct E {
11 struct {
Richard Smithac713512012-12-08 02:53:02 +000012 S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}}
Argyrios Kyrtzidisdd7744d2010-08-16 17:27:08 +000013 };
David Blaikie2b79c322011-10-19 22:43:29 +000014 static struct {
15 };
Argyrios Kyrtzidisdd7744d2010-08-16 17:27:08 +000016};
Stephen Hines651f13c2014-04-23 16:59:28 -070017
18template <class T> void foo(T);
19typedef struct { // expected-note {{use a tag name here to establish linkage prior to definition}} expected-note {{declared here}}
20 void test() {
21 foo(this); // expected-warning {{template argument uses unnamed type}}
22 }
23} A; // expected-error {{unsupported: typedef changes linkage of anonymous type, but linkage was already computed}}