blob: 1b5dc13cea01542a56c2233b05418494debe1375 [file] [log] [blame]
Argyrios Kyrtzidis33aee392010-08-16 17:27:08 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3struct S {
Richard Smith92f241f2012-12-08 02:53:02 +00004 S(); // expected-note {{because type 'S' has a user-provided default constructor}}
Argyrios Kyrtzidis33aee392010-08-16 17:27:08 +00005};
6
David Blaikie0a8e8992011-10-19 22:43:29 +00007struct { // expected-error {{anonymous structs and classes must be class members}}
8};
9
Argyrios Kyrtzidis33aee392010-08-16 17:27:08 +000010struct E {
11 struct {
Richard Smith92f241f2012-12-08 02:53:02 +000012 S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}}
Argyrios Kyrtzidis33aee392010-08-16 17:27:08 +000013 };
David Blaikie0a8e8992011-10-19 22:43:29 +000014 static struct {
15 };
Argyrios Kyrtzidis33aee392010-08-16 17:27:08 +000016};
John McCall2575d882014-01-30 01:12:53 +000017
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}}