Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 |
Richard Smith | 34b41d9 | 2011-02-20 03:19:35 +0000 | [diff] [blame] | 2 | |
| 3 | extern int a; |
| 4 | auto a = 0; // expected-note 2{{here}} |
| 5 | auto a = 0; // expected-error {{redefinition}} |
| 6 | int a = 0; // expected-error {{redefinition}} |
| 7 | extern auto a; // expected-error {{requires an initializer}} |
| 8 | |
| 9 | extern int b; // expected-note {{here}} |
| 10 | auto b = 0.0; // expected-error {{different type}} |
| 11 | |
| 12 | struct S { |
| 13 | static int a; |
| 14 | static int b; // expected-note {{here}} |
| 15 | }; |
| 16 | |
| 17 | auto S::a = 0; // expected-note 2{{here}} |
| 18 | auto S::a; // expected-error {{redefinition}} expected-error {{requires an initializer}} |
| 19 | int S::a = 0; // expected-error {{redefinition}} |
| 20 | |
| 21 | auto S::b = 0.0; // expected-error {{different type}} |
| 22 | |
| 23 | void f() { |
| 24 | extern int a; |
| 25 | extern auto a; // expected-error {{requires an initializer}} |
| 26 | } |