27 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++112 3extern int a;4auto a = 0; // expected-note 2{{here}}5auto a = 0; // expected-error {{redefinition}}6int a = 0; // expected-error {{redefinition}}7extern auto a; // expected-error {{requires an initializer}}8 9extern int b; // expected-note {{here}}10auto b = 0.0; // expected-error {{different type}}11 12struct S {13 static int a;14 static int b; // expected-note {{here}}15};16 17auto S::a = 0; // expected-note 2{{here}}18auto S::a; // expected-error {{redefinition}} expected-error {{requires an initializer}}19int S::a = 0; // expected-error {{redefinition}}20 21auto S::b = 0.0; // expected-error {{different type}}22 23void f() {24 extern int a;25 extern auto a; // expected-error {{requires an initializer}}26}27