[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / redeclared-auto.cpp
blob87ad6bd7e5d83c3cf6802d12f9a2bf4cd3b12268
1 // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
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}}
9 extern int b; // expected-note {{here}}
10 auto b = 0.0; // expected-error {{different type}}
12 struct S {
13 static int a;
14 static int b; // expected-note {{here}}
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}}
21 auto S::b = 0.0; // expected-error {{different type}}
23 void f() {
24 extern int a;
25 extern auto a; // expected-error {{requires an initializer}}