Argyrios Kyrtzidis | 33aee39 | 2010-08-16 17:27:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | struct S { |
Richard Smith | 92f241f | 2012-12-08 02:53:02 +0000 | [diff] [blame] | 4 | S(); // expected-note {{because type 'S' has a user-provided default constructor}} |
Argyrios Kyrtzidis | 33aee39 | 2010-08-16 17:27:08 +0000 | [diff] [blame] | 5 | }; |
| 6 | |
David Blaikie | 0a8e899 | 2011-10-19 22:43:29 +0000 | [diff] [blame] | 7 | struct { // expected-error {{anonymous structs and classes must be class members}} |
| 8 | }; |
| 9 | |
Argyrios Kyrtzidis | 33aee39 | 2010-08-16 17:27:08 +0000 | [diff] [blame] | 10 | struct E { |
| 11 | struct { |
Richard Smith | 92f241f | 2012-12-08 02:53:02 +0000 | [diff] [blame] | 12 | S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}} |
Argyrios Kyrtzidis | 33aee39 | 2010-08-16 17:27:08 +0000 | [diff] [blame] | 13 | }; |
David Blaikie | 0a8e899 | 2011-10-19 22:43:29 +0000 | [diff] [blame] | 14 | static struct { |
| 15 | }; |
Argyrios Kyrtzidis | 33aee39 | 2010-08-16 17:27:08 +0000 | [diff] [blame] | 16 | }; |
John McCall | 2575d88 | 2014-01-30 01:12:53 +0000 | [diff] [blame^] | 17 | |
| 18 | template <class T> void foo(T); |
| 19 | typedef 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}} |