// expected-error@second.h:* {{'AccessSpecifiers::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found end of class}}
#endif
#if defined(FIRST)
structS2{
public:
};
#elif defined(SECOND)
structS2{
protected:
};
#else
S2s2;
// expected-error@second.h:* {{'AccessSpecifiers::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found protected access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}
// expected-error@second.h:* {{'StaticAssert::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found static assert with message}}
// expected-note@first.h:* {{but in 'FirstModule' found static assert with different message}}
#endif
#if defined(FIRST)
structS2{
static_assert(2==2,"Message");
};
#elif defined(SECOND)
structS2{
static_assert(2==2);
};
#else
S2s2;
// expected-error@second.h:* {{'StaticAssert::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found static assert with no message}}
// expected-note@first.h:* {{but in 'FirstModule' found static assert with message}}
#endif
#if defined(FIRST)
structS3{
static_assert(3==3,"Message");
};
#elif defined(SECOND)
structS3{
static_assert(3!=4,"Message");
};
#else
S3s3;
// expected-error@second.h:* {{'StaticAssert::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found static assert with condition}}
// expected-note@first.h:* {{but in 'FirstModule' found static assert with different condition}}
#endif
#if defined(FIRST)
structS4{
static_assert(4==4,"Message");
};
#elif defined(SECOND)
structS4{
public:
};
#else
S4s4;
// expected-error@second.h:* {{'StaticAssert::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found public access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found static assert}}
// expected-error@second.h:* {{'Field::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found field}}
// expected-note@first.h:* {{but in 'FirstModule' found private access specifier}}
#endif
#if defined(FIRST)
structS2{
intx;
inty;
};
#elif defined(SECOND)
structS2{
inty;
intx;
};
#else
S2s2;
// expected-error@second.h:* {{'Field::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'y'}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x'}}
// expected-error@second.h:* {{'Field::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'Field::B' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'Field::A' (aka 'int')}}
// expected-error@second.h:* {{'Field::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'int'}}
// expected-error@second.h:* {{'Field::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found bitfield 'x'}}
// expected-note@first.h:* {{but in 'FirstModule' found non-bitfield 'x'}}
#endif
#if defined(FIRST)
structS7{
unsignedx:2;
};
#elif defined(SECOND)
structS7{
unsignedx:1;
};
#else
S7s7;
// expected-error@second.h:* {{'Field::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found bitfield 'x' with one width expression}}
// expected-note@first.h:* {{but in 'FirstModule' found bitfield 'x' with different width expression}}
#endif
#if defined(FIRST)
structS8{
unsignedx:2;
};
#elif defined(SECOND)
structS8{
unsignedx:1+1;
};
#else
S8s8;
// expected-error@second.h:* {{'Field::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found bitfield 'x' with one width expression}}
// expected-note@first.h:* {{but in 'FirstModule' found bitfield 'x' with different width expression}}
// expected-error@second.h:* {{'Field::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found non-mutable field 'x'}}
// expected-note@first.h:* {{but in 'FirstModule' found mutable field 'x'}}
#endif
#if defined(FIRST)
structS10{
unsignedx=5;
};
#elif defined(SECOND)
structS10{
unsignedx;
};
#else
S10s10;
// expected-error@second.h:* {{'Field::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with no initalizer}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with an initializer}}
#endif
#if defined(FIRST)
structS11{
unsignedx=5;
};
#elif defined(SECOND)
structS11{
unsignedx=7;
};
#else
S11s11;
// expected-error@second.h:* {{'Field::S11' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with an initializer}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with a different initializer}}
// expected-error@second.h:* {{'Method::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found method}}
#endif
#if defined(FIRST)
structS2{
voidA(){}
voidB(){}
};
#elif defined(SECOND)
structS2{
voidB(){}
voidA(){}
};
#else
S2s2;
// expected-error@second.h:* {{'Method::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'B'}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A'}}
// expected-error@second.h:* {{'Method::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' is not static}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' is static}}
#endif
#if defined(FIRST)
structS4{
virtualvoidA(){}
voidB(){}
};
#elif defined(SECOND)
structS4{
voidA(){}
virtualvoidB(){}
};
#else
S4s4;
// expected-error@second.h:* {{'Method::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' is not virtual}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' is virtual}}
#endif
#if defined(FIRST)
structS5{
virtualvoidA()=0;
virtualvoidB(){};
};
#elif defined(SECOND)
structS5{
virtualvoidA(){}
virtualvoidB()=0;
};
#else
S5*s5;
// expected-error@second.h:* {{'Method::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' is virtual}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' is pure virtual}}
#endif
#if defined(FIRST)
structS6{
inlinevoidA(){}
};
#elif defined(SECOND)
structS6{
voidA(){}
};
#else
S6s6;
// expected-error@second.h:* {{'Method::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' is not inline}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' is inline}}
#endif
#if defined(FIRST)
structS7{
voidA()volatile{}
voidA(){}
};
#elif defined(SECOND)
structS7{
voidA(){}
voidA()volatile{}
};
#else
S7s7;
// expected-error@second.h:* {{'Method::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' is not volatile}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' is volatile}}
#endif
#if defined(FIRST)
structS8{
voidA()const{}
voidA(){}
};
#elif defined(SECOND)
structS8{
voidA(){}
voidA()const{}
};
#else
S8s8;
// expected-error@second.h:* {{'Method::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' is not const}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' is const}}
// expected-error@second.h:* {{'Method::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' that has 2 parameters}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' that has 1 parameter}}
#endif
#if defined(FIRST)
structS10{
voidA(intx){}
voidA(floatx){}
};
#elif defined(SECOND)
structS10{
voidA(floatx){}
voidA(intx){}
};
#else
S10s10;
// expected-error@second.h:* {{'Method::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter of type 'float'}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter of type 'int'}}
#endif
#if defined(FIRST)
structS11{
voidA(intx){}
};
#elif defined(SECOND)
structS11{
voidA(inty){}
};
#else
S11s11;
// expected-error@second.h:* {{'Method::S11' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter named 'y'}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter named 'x'}}
#endif
#if defined(FIRST)
structS12{
voidA(intx){}
};
#elif defined(SECOND)
structS12{
voidA(intx=1){}
};
#else
S12s12;
// TODO: This should produce an error.
#endif
#if defined(FIRST)
structS13{
voidA(intx=1+0){}
};
#elif defined(SECOND)
structS13{
voidA(intx=1){}
};
#else
S13s13;
// TODO: This should produce an error.
#endif
#if defined(FIRST)
structS14{
voidA(intx[2]){}
};
#elif defined(SECOND)
structS14{
voidA(intx[3]){}
};
#else
S14s14;
// expected-error@second.h:* {{'Method::S14' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int [3]'}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter of type 'int *' decayed from 'int [2]'}}
// expected-error@second.h:* {{'TypeDef::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found typedef name 'b'}}
// expected-note@first.h:* {{but in 'FirstModule' found typedef name 'a'}}
#endif
#if defined(FIRST)
structS5{
typedefinta;
typedefintb;
intx;
};
#elif defined(SECOND)
structS5{
intx;
typedefintb;
typedefinta;
};
#else
S5s5;
// expected-error@second.h:* {{'TypeDef::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field}}
// expected-note@first.h:* {{but in 'FirstModule' found typedef}}
#endif
#if defined(FIRST)
typedeffloatF;
structS6{
typedefinta;
typedefFb;
};
#elif defined(SECOND)
structS6{
typedefinta;
typedeffloatb;
};
#else
S6s6;
// expected-error@second.h:* {{'TypeDef::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found typedef 'b' with underlying type 'float'}}
// expected-note@first.h:* {{but in 'FirstModule' found typedef 'b' with different underlying type 'TypeDef::F' (aka 'float')}}
// expected-error@second.h:* {{'Using::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias name 'b'}}
// expected-note@first.h:* {{but in 'FirstModule' found type alias name 'a'}}
#endif
#if defined(FIRST)
structS5{
usinga=int;
usingb=int;
intx;
};
#elif defined(SECOND)
structS5{
intx;
usingb=int;
usinga=int;
};
#else
S5s5;
// expected-error@second.h:* {{'Using::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field}}
// expected-note@first.h:* {{but in 'FirstModule' found type alias}}
#endif
#if defined(FIRST)
typedeffloatF;
structS6{
usinga=int;
usingb=F;
};
#elif defined(SECOND)
structS6{
usinga=int;
usingb=float;
};
#else
S6s6;
// expected-error@second.h:* {{'Using::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias 'b' with underlying type 'float'}}
// expected-note@first.h:* {{but in 'FirstModule' found type alias 'b' with different underlying type 'Using::F' (aka 'float')}}
// expected-error@first.h:* {{'RecordType::S1::x' from module 'FirstModule' is not present in definition of 'RecordType::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
}
namespaceDependentType{
#if defined(FIRST)
template<classT>
classS1{
typenameT::typeAx;
};
#elif defined(SECOND)
template<classT>
classS1{
typenameT::typeBx;
};
#else
template<classT>
usingU1=S1<T>;
// expected-error@first.h:* {{'DependentType::S1::x' from module 'FirstModule' is not present in definition of 'S1<T>' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
}
namespaceElaboratedType{
#if defined(FIRST)
namespaceN1{usingtype=double;}
structS1{
N1::typex;
};
#elif defined(SECOND)
namespaceN1{usingtype=int;}
structS1{
N1::typex;
};
#else
S1s1;
// expected-error@first.h:* {{'ElaboratedType::S1::x' from module 'FirstModule' is not present in definition of 'ElaboratedType::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
}
namespaceEnum{
#if defined(FIRST)
enumA1{};
structS1{
A1x;
};
#elif defined(SECOND)
enumA2{};
structS1{
A2x;
};
#else
S1s1;
// expected-error@first.h:* {{'Enum::S1::x' from module 'FirstModule' is not present in definition of 'Enum::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'LevelB1::LevelC1::Type' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'LevelA1::Type' (aka 'int')}}
#endif
#if defined(FIRST)
namespaceLevelA2{usingType=int;}
structS2{
LevelA2::Typex;
};
# elif defined(SECOND)
structS2{
intx;
};
#else
S2s2;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'int'}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'LevelA2::Type' (aka 'int')}}
#endif
namespaceLevelA3{usingType=int;}
namespaceLevelB3{usingType=int;}
#if defined(FIRST)
structS3{
LevelA3::Typex;
};
# elif defined(SECOND)
structS3{
LevelB3::Typex;
};
#else
S3s3;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'LevelB3::Type' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'LevelA3::Type' (aka 'int')}}
#endif
#if defined(FIRST)
structTA4{usingType=int;};
structS4{
TA4::Typex;
};
# elif defined(SECOND)
structTB4{usingType=int;};
structS4{
TB4::Typex;
};
#else
S4s4;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'TB4::Type' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'TA4::Type' (aka 'int')}}
#endif
#if defined(FIRST)
structT5{usingType=int;};
structS5{
T5::Typex;
};
# elif defined(SECOND)
namespaceT5{usingType=int;};
structS5{
T5::Typex;
};
#else
S5s5;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'T5::Type' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'T5::Type' (aka 'int')}}
#endif
#if defined(FIRST)
namespaceN6{usingI=int;}
structS6{
NestedNamespaceSpecifier::N6::Ix;
};
# elif defined(SECOND)
usingI=int;
structS6{
::NestedNamespaceSpecifier::Ix;
};
#else
S6s6;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '::NestedNamespaceSpecifier::I' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'NestedNamespaceSpecifier::N6::I' (aka 'int')}}
#endif
#if defined(FIRST)
template<classT,classU>
classS7{
typenameT::type*x={};
intz=x->T::foo();
};
#elif defined(SECOND)
template<classT,classU>
classS7{
typenameT::type*x={};
intz=x->U::foo();
};
#else
template<classT,classU>
usingU7=S7<T,U>;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'z' with an initializer}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'z' with a different initializer}}
#endif
#if defined(FIRST)
template<classT>
classS8{
intx=T::templateX<int>::value;
};
#elif defined(SECOND)
template<classT>
classS8{
intx=T::templateY<int>::value;
};
#else
template<classT>
usingU8=S8<T>;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with an initializer}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with a different initializer}}
#endif
#if defined(FIRST)
namespaceN9{usingI=int;}
namespaceO9=N9;
structS9{
O9::Ix;
};
#elif defined(SECOND)
namespaceN9{usingI=int;}
namespaceP9=N9;
structS9{
P9::Ix;
};
#else
S9s9;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type 'P9::I' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'O9::I' (aka 'int')}}
// expected-error@first.h:* {{'TemplateSpecializationType::S1::u' from module 'FirstModule' is not present in definition of 'TemplateSpecializationType::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'u' does not match}}
#endif
#if defined(FIRST)
template<classT1>structU2{};
structS2{
U2<int>u;
};
#elif defined(SECOND)
template<classT1>structV1{};
structS2{
V1<int>u;
};
#else
S2s2;
// expected-error@first.h:* {{'TemplateSpecializationType::S2::u' from module 'FirstModule' is not present in definition of 'TemplateSpecializationType::S2' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'u' does not match}}
// expected-error@first.h:* {{'TemplateArgument::S1::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// expected-error@second.h:* {{'TemplateArgument::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias 'T' with underlying type 'U2<(2)>'}}
// expected-note@first.h:* {{but in 'FirstModule' found type alias 'T' with different underlying type 'U2<2>'}}
#endif
#if defined(FIRST)
template<int>structU3{};
structS3{
usingT=U3<2>;
};
#elif defined(SECOND)
template<int>structU3{};
structS3{
usingT=U3<1+1>;
};
#else
S3s3;
// expected-error@second.h:* {{'TemplateArgument::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias 'T' with underlying type 'U3<1 + 1>'}}
// expected-note@first.h:* {{but in 'FirstModule' found type alias 'T' with different underlying type 'U3<2>'}}
// expected-error@first.h:* {{'TemplateArgument::S4::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S4' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// expected-error@second.h:* {{'AllDecls::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found public access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found private access specifier}}
#endif
}
namespaceFriendFunction{
#if defined(FIRST)
voidF(int=0);
structS{friendvoidF(int);};
#elif defined(SECOND)
voidF(int);
structS{friendvoidF(int);};
#else
Ss;
#endif
#if defined(FIRST)
voidG(int=0);
structT{
friendvoidG(int);
private:
};
#elif defined(SECOND)
voidG(int);
structT{
friendvoidG(int);
public:
};
#else
Tt;
// expected-error@second.h:* {{'FriendFunction::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found public access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found private access specifier}}
#endif
}// namespace FriendFunction
namespaceImplicitDecl{
#if defined(FIRST)
structS{};
voidS_Constructors(){
// Trigger creation of implicit contructors
Sfoo;
Sbar=foo;
Sbaz(bar);
}
#elif defined(SECOND)
structS{};
#else
Ss;
#endif
#if defined(FIRST)
structT{
private:
};
voidT_Constructors(){
// Trigger creation of implicit contructors
Tfoo;
Tbar=foo;
Tbaz(bar);
}
#elif defined(SECOND)
structT{
public:
};
#else
Tt;
// expected-error@first.h:* {{'ImplicitDecl::T' has different definitions in different modules; first difference is definition in module 'FirstModule' found private access specifier}}
// expected-note@second.h:* {{but in 'SecondModule' found public access specifier}}
#endif
}// namespace ImplicitDelc
namespaceTemplatedClass{
#if defined(FIRST)
template<class>
structS{};
#elif defined(SECOND)
template<class>
structS{};
#else
S<int>s;
#endif
#if defined(FIRST)
template<class>
structT{
private:
};
#elif defined(SECOND)
template<class>
structT{
public:
};
#else
T<int>t;
// expected-error@second.h:* {{'TemplatedClass::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found public access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found private access specifier}}
#endif
}// namespace TemplatedClass
namespaceTemplateClassWithField{
#if defined(FIRST)
template<classA>
structS{
Aa;
};
#elif defined(SECOND)
template<classA>
structS{
Aa;
};
#else
S<int>s;
#endif
#if defined(FIRST)
template<classA>
structT{
Aa;
private:
};
#elif defined(SECOND)
template<classA>
structT{
Aa;
public:
};
#else
T<int>t;
// expected-error@second.h:* {{'TemplateClassWithField::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found public access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found private access specifier}}
#endif
}// namespace TemplateClassWithField
namespaceTemplateClassWithTemplateField{
#if defined(FIRST)
template<classA>
classWrapperS;
template<classA>
structS{
WrapperS<A>a;
};
#elif defined(SECOND)
template<classA>
classWrapperS;
template<classA>
structS{
WrapperS<A>a;
};
#else
template<classA>
classWrapperS{};
S<int>s;
#endif
#if defined(FIRST)
template<classA>
classWrapperT;
template<classA>
structT{
WrapperT<A>a;
public:
};
#elif defined(SECOND)
template<classA>
classWrapperT;
template<classA>
structT{
WrapperT<A>a;
private:
};
#else
template<classA>
classWrapperT{};
T<int>t;
// expected-error@second.h:* {{'TemplateClassWithTemplateField::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}
#endif
}// namespace TemplateClassWithTemplateField
namespaceEnumWithForwardDeclaration{
#if defined(FIRST)
enumE:int;
structS{
voidget(E){}
};
#elif defined(SECOND)
enumE:int{A,B};
structS{
voidget(E){}
};
#else
Ss;
#endif
#if defined(FIRST)
structT{
voidget(E){}
public:
};
#elif defined(SECOND)
structT{
voidget(E){}
private:
};
#else
Tt;
// expected-error@second.h:* {{'EnumWithForwardDeclaration::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}
#endif
}// namespace EnumWithForwardDeclaration
namespaceStructWithForwardDeclaration{
#if defined(FIRST)
structP{};
structS{
structP*ptr;
};
#elif defined(SECOND)
structS{
structP*ptr;
};
#else
Ss;
#endif
#if defined(FIRST)
structQ{};
structT{
structQ*ptr;
public:
};
#elif defined(SECOND)
structT{
structQ*ptr;
private:
};
#else
Tt;
// expected-error@second.h:* {{'StructWithForwardDeclaration::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}
// expected-error@second.h:* {{'StructWithForwardDeclarationNoDefinition::T' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}