// 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'}}
// expected-error@second.h:* {{'Method::S12' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter without a default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter with a default argument}}
// expected-error@second.h:* {{'Method::S13' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'A' with 1st parameter with a default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'A' with 1st parameter with a different default argument}}
// 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:* {{'Constructor::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'foo'}}
// expected-note@first.h:* {{but in 'FirstModule' found constructor}}
#endif
#if defined(FIRST)
structS2{
S2(int){}
S2(int,int){}
};
#elif defined(SECOND)
structS2{
S2(int,int){}
S2(int){}
};
#else
S2*s2;
// expected-error@second.h:* {{'Constructor::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found constructor that has 2 parameters}}
// expected-note@first.h:* {{but in 'FirstModule' found constructor that has 1 parameter}}
#endif
}// namespace Constructor
namespaceDestructor{
#if defined(FIRST)
structS1{
~S1(){}
S1(){}
};
#elif defined(SECOND)
structS1{
S1(){}
~S1(){}
};
#else
S1s1;
// expected-error@second.h:* {{'Destructor::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found constructor}}
// expected-note@first.h:* {{but in 'FirstModule' found destructor}}
#endif
#if defined(FIRST)
structS2{
virtual~S2(){}
voidfoo(){}
};
#elif defined(SECOND)
structS2{
~S2(){}
virtualvoidfoo(){}
};
#else
S2s2;
// expected-error@second.h:* {{'Destructor::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found destructor is not virtual}}
// expected-note@first.h:* {{but in 'FirstModule' found destructor is virtual}}
// 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@second.h:* {{'NestedNamespaceSpecifier::N10::S10::x' from module 'SecondModule' is not present in definition of 'NestedNamespaceSpecifier::N10::S10' in module 'FirstModule'}}
// expected-note@first.h:* {{declaration of 'x' does not match}}
// 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@first.h:* {{'TemplateArgument::S5::x' from module 'FirstModule' is not present in definition of 'TemplateArgument::S5' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
template<classT>structU6{};
structS6{
U6<int>x;
U6<short>y;
};
#elif defined(SECOND)
template<classT>structU6{};
structS6{
U6<short>y;
U6<int>x;
};
#else
S6s6;
// expected-error@second.h:* {{'TemplateArgument::S6' 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@first.h:* {{'TemplateTypeParmType::S1::x' from module 'FirstModule' is not present in definition of 'S1<T1, T2>' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// expected-error@first.h:* {{'TemplateTypeParmType::S2::x' from module 'FirstModule' is not present in definition of 'S2<T, U>' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// expected-error@first.h:* {{'TemplateTypeParmType::S2::type' from module 'FirstModule' is not present in definition of 'S2<T, U>' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'type' does not match}}
// expected-error@second.h:* {{'VarDecl::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member with name 'y'}}
// expected-note@first.h:* {{but in 'FirstModule' found data member with name 'x'}}
#endif
#if defined(FIRST)
structS2{
staticintx;
};
#elif defined(SECOND)
usingI=int;
structS2{
staticIx;
};
#else
S2s2;
// expected-error@second.h:* {{'VarDecl::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member 'x' with type 'VarDecl::I' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found data member 'x' with different type 'int'}}
#endif
#if defined(FIRST)
structS3{
staticconstintx=1;
};
#elif defined(SECOND)
structS3{
staticconstintx;
};
#else
S3s3;
// expected-error@second.h:* {{'VarDecl::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member 'x' with an initializer}}
// expected-note@first.h:* {{but in 'FirstModule' found data member 'x' without an initializer}}
#endif
#if defined(FIRST)
structS4{
staticconstintx=1;
};
#elif defined(SECOND)
structS4{
staticconstintx=2;
};
#else
S4s4;
// expected-error@second.h:* {{'VarDecl::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member 'x' with an initializer}}
// expected-note@first.h:* {{but in 'FirstModule' found data member 'x' with a different initializer}}
#endif
#if defined(FIRST)
structS5{
staticconstintx=1;
};
#elif defined(SECOND)
structS5{
staticconstexprintx=1;
};
#else
S5s5;
// expected-error@second.h:* {{'VarDecl::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member 'x' is not constexpr}}
// expected-note@first.h:* {{but in 'FirstModule' found data member 'x' is constexpr}}
#endif
#if defined(FIRST)
structS6{
staticconstintx=1;
};
#elif defined(SECOND)
structS6{
staticconstinty=1;
};
#else
S6s6;
// expected-error@first.h:* {{'VarDecl::S6::x' from module 'FirstModule' is not present in definition of 'VarDecl::S6' in module 'SecondModule'}}
// expected-note@second.h:* {{definition has no member 'x'}}
#endif
#if defined(FIRST)
structS7{
staticconstintx=1;
};
#elif defined(SECOND)
structS7{
staticconstunsignedx=1;
};
#else
S7s7;
// expected-error@first.h:* {{'VarDecl::S7::x' from module 'FirstModule' is not present in definition of 'VarDecl::S7' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
structS8{
public:
staticconstintx=1;
};
#elif defined(SECOND)
structS8{
staticconstintx=1;
public:
};
#else
S8s8;
// expected-error@second.h:* {{'VarDecl::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found data member}}
// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}
#endif
#if defined(FIRST)
structS9{
staticconstintx=1;
};
#elif defined(SECOND)
structS9{
staticintx;
};
#else
S9s9;
// expected-error@first.h:* {{'VarDecl::S9::x' from module 'FirstModule' is not present in definition of 'VarDecl::S9' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
template<typenameT>
structS{
structR{
voidfoo(Tx=0){}
};
};
#elif defined(SECOND)
template<typenameT>
structS{
structR{
voidfoo(Tx=1){}
};
};
#else
voidrun(){
S<int>::R().foo();
}
// expected-error@second.h:* {{'VarDecl::S::R' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'foo' with 1st parameter with a default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'foo' with 1st parameter with a different default argument}}
#endif
#if defined(FIRST)
template<typenamealpha>structBravo{
voidcharlie(booldelta=false){}
};
typedefBravo<char>echo;
echofoxtrot;
#elif defined(SECOND)
template<typenamealpha>structBravo{
voidcharlie(booldelta=(false)){}
};
typedefBravo<char>echo;
echofoxtrot;
#else
Bravo<char>golf;
// expected-error@second.h:* {{'VarDecl::Bravo' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'charlie' with 1st parameter with a default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'charlie' with 1st parameter with a different default argument}}
// expected-error@second.h:* {{'Friend::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend 'Friend::T1'}}
// expected-note@first.h:* {{but in 'FirstModule' found friend 'class T1'}}
#endif
#if defined(FIRST)
structT2{};
structS2{
friendclassT2;
};
#elif defined(SECOND)
structT2{};
structS2{
friendstructT2;
};
#else
S2s2;
// expected-error@second.h:* {{'Friend::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend 'struct T2'}}
// expected-note@first.h:* {{but in 'FirstModule' found friend 'class T2'}}
#endif
#if defined(FIRST)
structT3{};
structS3{
friendconstT3;
};
#elif defined(SECOND)
structT3{};
structS3{
friendT3;
};
#else
S3s3;
// expected-error@second.h:* {{'Friend::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend 'Friend::T3'}}
// expected-note@first.h:* {{but in 'FirstModule' found friend 'const Friend::T3'}}
#endif
#if defined(FIRST)
structT4{};
structS4{
friendT4;
};
#elif defined(SECOND)
structS4{
friendvoidT4();
};
#else
S4s4;
// expected-error@second.h:* {{'Friend::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend function}}
// expected-note@first.h:* {{but in 'FirstModule' found friend class}}
#endif
#if defined(FIRST)
structS5{
friendvoidT5a();
};
#elif defined(SECOND)
structS5{
friendvoidT5b();
};
#else
S5s5;
// expected-error@second.h:* {{'Friend::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found friend function 'T5b'}}
// expected-note@first.h:* {{but in 'FirstModule' found friend function 'T5a'}}
// expected-error@second.h:* {{'TemplateParameters::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found template parameter 'B'}}
// expected-note@first.h:* {{but in 'FirstModule' found template parameter 'A'}}
#endif
#if defined(FIRST)
template<classA=double>
structS2{};
#elif defined(SECOND)
template<classA=int>
structS2{};
#else
usingTemplateParameters::S2;
// expected-error@second.h:* {{'TemplateParameters::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found template parameter with default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found template parameter with different default argument}}
#endif
#if defined(FIRST)
template<classA=int>
structS3{};
#elif defined(SECOND)
template<classA>
structS3{};
#else
usingTemplateParameters::S3;
// expected-error@second.h:* {{'TemplateParameters::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found template parameter with no default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found template parameter with default argument}}
#endif
#if defined(FIRST)
template<intA>
structS4{};
#elif defined(SECOND)
template<intA=2>
structS4{};
#else
usingTemplateParameters::S4;
// expected-error@second.h:* {{'TemplateParameters::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found template parameter with default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found template parameter with no default argument}}
#endif
#if defined(FIRST)
template<int>classS5_first{};
template<template<int>classA=S5_first>
structS5{};
#elif defined(SECOND)
template<int>classS5_second{};
template<template<int>classA=S5_second>
structS5{};
#else
usingTemplateParameters::S5;
// expected-error@second.h:* {{'TemplateParameters::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found template parameter with default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found template parameter with different default argument}}
#endif
#if defined(FIRST)
template<classA>
structS6{};
#elif defined(SECOND)
template<class>
structS6{};
#else
usingTemplateParameters::S6;
// expected-error@second.h:* {{'TemplateParameters::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found unnamed template parameter}}
// expected-note@first.h:* {{but in 'FirstModule' found template parameter 'A'}}
// expected-error@second.h:* {{'BaseClass::S1' has different definitions in different modules; first difference is definition in module 'SecondModule' found 0 base classes}}
// expected-note@first.h:* {{but in 'FirstModule' found 1 base class}}
#endif
#if defined(FIRST)
structS2{};
#elif defined(SECOND)
structB2{};
structS2:virtualB2{};
#else
S2s2;
// expected-error@second.h:* {{'BaseClass::S2' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1 base class}}
// expected-note@first.h:* {{but in 'FirstModule' found 0 base classes}}
#endif
#if defined(FIRST)
structB3a{};
structS3:B3a{};
#elif defined(SECOND)
structB3b{};
structS3:virtualB3b{};
#else
S3s3;
// expected-error@second.h:* {{'BaseClass::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1 virtual base class}}
// expected-note@first.h:* {{but in 'FirstModule' found 0 virtual base classes}}
#endif
#if defined(FIRST)
structB4a{};
structS4:B4a{};
#elif defined(SECOND)
structB4b{};
structS4:B4b{};
#else
S4s4;
// expected-error@second.h:* {{'BaseClass::S4' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class with type 'BaseClass::B4b'}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st base class with different type 'BaseClass::B4a'}}
#endif
#if defined(FIRST)
structB5a{};
structS5:virtualB5a{};
#elif defined(SECOND)
structB5a{};
structS5:B5a{};
#else
S5s5;
// expected-error@second.h:* {{'BaseClass::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found 0 virtual base classes}}
// expected-note@first.h:* {{but in 'FirstModule' found 1 virtual base class}}
#endif
#if defined(FIRST)
structB6a{};
structS6:B6a{};
#elif defined(SECOND)
structB6a{};
structS6:virtualB6a{};
#else
S6s6;
// expected-error@second.h:* {{'BaseClass::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1 virtual base class}}
// expected-note@first.h:* {{but in 'FirstModule' found 0 virtual base classes}}
#endif
#if defined(FIRST)
structB7a{};
structS7:protectedB7a{};
#elif defined(SECOND)
structB7a{};
structS7:B7a{};
#else
S7s7;
// expected-error@second.h:* {{'BaseClass::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B7a' with no access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B7a' with protected access specifier}}
#endif
#if defined(FIRST)
structB8a{};
structS8:publicB8a{};
#elif defined(SECOND)
structB8a{};
structS8:privateB8a{};
#else
S8s8;
// expected-error@second.h:* {{'BaseClass::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B8a' with private access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B8a' with public access specifier}}
#endif
#if defined(FIRST)
structB9a{};
structS9:privateB9a{};
#elif defined(SECOND)
structB9a{};
structS9:publicB9a{};
#else
S9s9;
// expected-error@second.h:* {{'BaseClass::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B9a' with public access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B9a' with private access specifier}}
#endif
#if defined(FIRST)
structB10a{};
structS10:B10a{};
#elif defined(SECOND)
structB10a{};
structS10:protectedB10a{};
#else
S10s10;
// expected-error@second.h:* {{'BaseClass::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found 1st base class 'BaseClass::B10a' with protected access specifier}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st base class 'BaseClass::B10a' with no access specifier}}
// 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}}