// 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:* {{'AccessSpecifiers::Invalid1' 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:* {{'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:* {{'StaticAssert::Invalid1' 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:* {{'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:* {{'Field::Invalid1' 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:* {{'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'}}
// 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:* {{'Method::Invalid1' 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@first.h:* {{'MethodBody::S2' has different definitions in different modules; first difference is definition in module 'FirstModule' found method 'BothBodies' with body}}
// expected-note@second.h:* {{but in 'SecondModule' found method 'BothBodies' with different body}}
#endif
#if defined(FIRST)
structS3{
intFirstBody(){return0;}
};
#elif defined(SECOND)
structS3{
intFirstBody();
};
#else
S3s3;
// expected-error@first.h:* {{'MethodBody::S3' has different definitions in different modules; first difference is definition in module 'FirstModule' found method 'FirstBody' with body}}
// expected-note@second.h:* {{but in 'SecondModule' found method 'FirstBody' with no body}}
#endif
#if defined(FIRST)
structS4{
intSecondBody();
};
#elif defined(SECOND)
structS4{
intSecondBody(){return0;}
};
#else
S4s4;
// expected-error@first.h:* {{'MethodBody::S4' has different definitions in different modules; first difference is definition in module 'FirstModule' found method 'SecondBody' with no body}}
// expected-note@second.h:* {{but in 'SecondModule' found method 'SecondBody' with body}}
#endif
#if defined(FIRST)
structS5{
intFirstBodySecondOutOfLine(){return0;}
};
#elif defined(SECOND)
structS5{
intFirstBodySecondOutOfLine();
};
intS5::FirstBodySecondOutOfLine(){return0;}
#else
S5s5;
// expected-error@second.h:* {{'MethodBody::S5' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'FirstBodySecondOutOfLine' with no body}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'FirstBodySecondOutOfLine' with body}}
#endif
#if defined(FIRST)
structS6{
intFirstOutOfLineSecondBody();
};
intS6::FirstOutOfLineSecondBody(){return0;}
#elif defined(SECOND)
structS6{
intFirstOutOfLineSecondBody(){return0;}
};
#else
S6s6;
// expected-error@first.h:* {{'MethodBody::S6' has different definitions in different modules; first difference is definition in module 'FirstModule' found method 'FirstOutOfLineSecondBody' with no body}}
// expected-note@second.h:* {{but in 'SecondModule' found method 'FirstOutOfLineSecondBody' with body}}
#endif
#if defined(FIRST)
structS7{
intBothOutOfLine();
};
intS7::BothOutOfLine(){return1;}
#elif defined(SECOND)
structS7{
intBothOutOfLine();
};
intS7::BothOutOfLine(){return0;}
#else
S7s7;
// expected-error@second.h:* {{'MethodBody::S7::BothOutOfLine' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
#endif
#if defined(FIRST)
structS8{
intFirstBodySecondOutOfLine(){return0;}
};
#elif defined(SECOND)
structS8{
intFirstBodySecondOutOfLine();
};
intS8::FirstBodySecondOutOfLine(){return1;}
#else
S8s8;
// expected-error@second.h:* {{'MethodBody::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'FirstBodySecondOutOfLine' with no body}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'FirstBodySecondOutOfLine' with body}}
#endif
#if defined(FIRST)
structS9{
intFirstOutOfLineSecondBody();
};
intS9::FirstOutOfLineSecondBody(){return1;}
#elif defined(SECOND)
structS9{
intFirstOutOfLineSecondBody(){return0;}
};
#else
S9s9;
// expected-error@first.h:* {{'MethodBody::S9' has different definitions in different modules; first difference is definition in module 'FirstModule' found method 'FirstOutOfLineSecondBody' with no body}}
// expected-note@second.h:* {{but in 'SecondModule' found method 'FirstOutOfLineSecondBody' with body}}
#endif
#if defined(FIRST)
structS10{
S10(int);
S10()=delete;
};
#elif defined(SECOND)
structS10{
S10(int);
S10();
};
#else
S10s10(10);
// expected-error@first.h:* {{'MethodBody::S10' has different definitions in different modules; first difference is definition in module 'FirstModule' found constructor is deleted}}
// expected-note@second.h:* {{but in 'SecondModule' found constructor is not deleted}}
#endif
#if defined(FIRST)
structS11{
S11()=default;
};
#elif defined(SECOND)
structS11{
S11();
};
#else
S11s11;
// expected-error@first.h:* {{'MethodBody::S11' has different definitions in different modules; first difference is definition in module 'FirstModule' found constructor is defaulted}}
// expected-note@second.h:* {{but in 'SecondModule' found constructor is not defaulted}}
#endif
#define DECLS(CLASSNAME) \
CLASSNAME()=default; \
~CLASSNAME()=delete; \
voidA(); \
voidB(){return;}; \
voidC(); \
voidD();
#define OUTOFLINEDEFS(CLASSNAME) \
voidCLASSNAME::C(){} \
voidCLASSNAME::D(){return;}
#if defined(FIRST) || defined(SECOND)
structValid1{
DECLS(Valid1)
};
OUTOFLINEDEFS(Valid1)
#else
Valid1*v1;
#endif
#if defined(FIRST) || defined(SECOND)
structInvalid1{
DECLS(Invalid1)
ACCESS
};
OUTOFLINEDEFS(Invalid1)
#else
Invalid1*i1;
// expected-error@first.h:* {{'MethodBody::Invalid1' has different definitions in different modules; first difference is definition in module 'FirstModule' found public access specifier}}
// expected-note@second.h:* {{but in 'SecondModule' found private access specifier}}
// 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}}
// expected-error@second.h:* {{'Constructor::Invalid1' 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:* {{'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:* {{'Destructor::Invalid1' 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:* {{'Destructor::Invalid2' 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:* {{'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:* {{'TypeDef::Invalid1' 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:* {{'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@second.h:* {{'Using::Invalid1' 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@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}}
// expected-error@second.h:* {{'RecordType::Invalid1' 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:* {{'DependentType::Invalid1' 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@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}}
// expected-error@second.h:* {{'ElaboratedType::Invalid1' 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:* {{'Enum::Invalid1' 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:* {{'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@second.h:* {{'NestedNamespaceSpecifier::Invalid1' 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
#undef DECLS
#define DECLS \
typenameT::type*x={}; \
inty=x->T::foo(); \
intz=U::templateX<int>::value;
#if defined(FIRST) || defined(SECOND)
template<classT,classU>
structValid2{
DECLS
};
#else
template<classT,classU>
usingV2=Valid2<T,U>;
#endif
#if defined(FIRST) || defined(SECOND)
template<classT,classU>
structInvalid2{
DECLS
ACCESS
};
#else
template<classT,classU>
usingI2=Invalid2<T,U>;
// expected-error@second.h:* {{'NestedNamespaceSpecifier::Invalid2' 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@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@second.h:* {{'TemplateSpecializationType::Invalid1' 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@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@second.h:* {{'TemplateArgument::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'run' with no template arguments}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'run' with template arguments}}
#endif
#if defined(FIRST)
structS8{
staticinta,b;
template<int&>voidrun(){}
template<int&,int&>voidrun(){}
template<>voidrun<a>(){}
};
#elif defined(SECOND)
structS8{
staticinta,b;
template<int&>voidrun(){}
template<int&,int&>voidrun(){}
template<>voidrun<a,b>(){}
};
#else
S8s8;
// expected-error@second.h:* {{'TemplateArgument::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'run' with 2 template arguments}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'run' with 1 template argument}}
#endif
#if defined(FIRST)
structS9{
staticinta,b;
template<int&>voidrun(){}
template<>voidrun<a>(){}
};
#elif defined(SECOND)
structS9{
staticinta,b;
template<int&>voidrun(){}
template<>voidrun<b>(){}
};
#else
S9s9;
// expected-error@second.h:* {{'TemplateArgument::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'run' with 'b' for 1st template argument}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'run' with 'a' for 1st template argument}}
#endif
#if defined(FIRST)
structS10{
staticinta,b;
template<int,int&...>voidrun(){}
template<>voidrun<1,a>(){}
};
#elif defined(SECOND)
structS10{
staticinta,b;
template<int,int&...>voidrun(){}
template<>voidrun<1,b>(){}
};
#else
S10s10;
// expected-error@second.h:* {{'TemplateArgument::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'run' with 'b' for 2nd template argument}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'run' with 'a' for 2nd template argument}}
#endif
#if defined(FIRST)
structS11{
staticinta,b;
template<int,int&...>voidrun(){}
template<>voidrun<1,a>(){}
};
#elif defined(SECOND)
structS11{
staticinta,b;
template<int,int&...>voidrun(){}
template<>voidrun<1,a,a>(){}
};
#else
S11s11;
// expected-error@second.h:* {{'TemplateArgument::S11' has different definitions in different modules; first difference is definition in module 'SecondModule' found method 'run' with 3 template arguments}}
// expected-note@first.h:* {{but in 'FirstModule' found method 'run' with 2 template arguments}}
// expected-error@second.h:* {{'TemplateArgument::Invalid1' 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@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:* {{'TemplateTypeParmType::Invalid1' 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:* {{'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}}
// expected-error@second.h:* {{'VarDecl::Invalid1' 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:* {{'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)
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:* {{'Friend::Invalid1' 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:* {{'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:* {{'TemplateParameters::Invalid1' 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:* {{'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:* {{'BaseClass::Invalid1' 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@first.h:* {{PointersAndReferences::S1::x' from module 'FirstModule' is not present in definition of 'PointersAndReferences::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
structS2{
Wrapper<int&&>x;
};
#elif defined(SECOND)
structS2{
Wrapper<float&&>x;
};
#else
S2s2;
// expected-error@first.h:* {{PointersAndReferences::S2::x' from module 'FirstModule' is not present in definition of 'PointersAndReferences::S2' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
structS3{
Wrapper<int*>x;
};
#elif defined(SECOND)
structS3{
Wrapper<float*>x;
};
#else
S3s3;
// expected-error@first.h:* {{PointersAndReferences::S3::x' from module 'FirstModule' is not present in definition of 'PointersAndReferences::S3' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
structS4{
Wrapper<int&>x;
};
#elif defined(SECOND)
structS4{
Wrapper<float&>x;
};
#else
S4s4;
// expected-error@first.h:* {{PointersAndReferences::S4::x' from module 'FirstModule' is not present in definition of 'PointersAndReferences::S4' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
structS5{
Wrapper<S5*>x;
};
#elif defined(SECOND)
structS5{
Wrapper<constS5*>x;
};
#else
S5s5;
// expected-error@second.h:* {{'PointersAndReferences::S5::x' from module 'SecondModule' is not present in definition of 'PointersAndReferences::S5' in module 'FirstModule'}}
// expected-note@first.h:* {{declaration of 'x' does not match}}
#endif
#if defined(FIRST)
structS6{
Wrapper<int&>x;
};
#elif defined(SECOND)
structS6{
Wrapper<constint&>x;
};
#else
S6s6;
// expected-error@first.h:* {{PointersAndReferences::S6::x' from module 'FirstModule' is not present in definition of 'PointersAndReferences::S6' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
#endif
#define DECLS \
Wrapper<int*>x1; \
Wrapper<float*>x2; \
Wrapper<constfloat*>x3; \
Wrapper<int&>x4; \
Wrapper<int&&>x5; \
Wrapper<constint&>x6; \
Wrapper<S1*>x7; \
Wrapper<S1&>x8; \
Wrapper<S1&&>x9;
#if defined(FIRST) || defined(SECOND)
structValid1{
DECLS
};
#else
Valid1v1;
#endif
#if defined(FIRST) || defined(SECOND)
structInvalid1{
DECLS
ACCESS
};
#else
Invalid1i1;
// expected-error@second.h:* {{'PointersAndReferences::Invalid1' 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@first.h:* {{'FunctionTemplate::S1::foo' from module 'FirstModule' is not present in definition of 'FunctionTemplate::S1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'foo' does not match}}
#endif
#if defined(FIRST)
structS2{
template<char>voidfoo();
};
#elif defined(SECOND)
structS2{
template<int>voidfoo();
};
#else
S2s2;
// expected-error@first.h:* {{'FunctionTemplate::S2::foo' from module 'FirstModule' is not present in definition of 'FunctionTemplate::S2' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'foo' does not match}}
#endif
#if defined(FIRST)
structS3{
template<intx>voidfoo();
};
#elif defined(SECOND)
structS3{
template<inty>voidfoo();
};
#else
S3s3;
// expected-error@second.h:* {{'FunctionTemplate::S3' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter named 'y'}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter named 'x'}}
#endif
#if defined(FIRST)
structS4{
template<intx>voidfoo();
};
#elif defined(SECOND)
structS4{
template<intx>voidbar();
};
#else
S4s4;
// expected-error@first.h:* {{'FunctionTemplate::S4::foo' from module 'FirstModule' is not present in definition of 'FunctionTemplate::S4' in module 'SecondModule'}}
// expected-note@second.h:* {{definition has no member 'foo'}}
#endif
#if defined(FIRST)
structS5{
template<intx>voidfoo();
};
#elif defined(SECOND)
structS5{
public:
template<intx>voidfoo();
};
#else
S5s5;
// expected-error@second.h:* {{'FunctionTemplate::S5' 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 function template}}
#endif
#if defined(FIRST)
structS6{
template<typenamex=int>voidfoo();
};
#elif defined(SECOND)
structS6{
template<typenamex>voidfoo();
};
#else
S6s6;
// expected-error@second.h:* {{'FunctionTemplate::S6' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with no default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument}}
#endif
#if defined(FIRST)
structS7{
template<typenamex=void>voidfoo();
};
#elif defined(SECOND)
structS7{
template<typenamex=int>voidfoo();
};
#else
S7s7;
// expected-error@second.h:* {{'FunctionTemplate::S7' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with default argument 'int'}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument 'void'}}
#endif
#if defined(FIRST)
template<int>
structU8{};
structS8{
template<template<int>classx=U8>voidfoo();
};
#elif defined(SECOND)
template<int>
structT8{};
structS8{
template<template<int>classx=T8>voidfoo();
};
#else
S8s8;
// expected-error@second.h:* {{'FunctionTemplate::S8' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with default argument 'T8'}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument 'U8'}}
#endif
#if defined(FIRST)
template<int>
structU9{};
structS9{S9();
template<template<int>classx=U9>voidfoo();
};
#elif defined(SECOND)
structS9{S9();
template<template<int>classx>voidfoo();
};
#else
S9s9;
// expected-error@second.h:* {{'FunctionTemplate::S9' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with no default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument}}
#endif
#if defined(FIRST)
structS10{
template<template<int>classx>voidfoo();
template<template<typename>classx>voidfoo();
};
#elif defined(SECOND)
structS10{
template<template<typename>classx>voidfoo();
template<template<int>classx>voidfoo();
};
#else
S10s10;
// expected-error@second.h:* {{'FunctionTemplate::S10' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with one type}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with different type}}
#endif
#if defined(FIRST)
structS11{
template<template<int>classx>voidfoo();
};
#elif defined(SECOND)
structS11{
template<template<int>class>voidfoo();
};
#else
S11s11;
// expected-error@second.h:* {{'FunctionTemplate::S11' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with no name}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter named 'x'}}
#endif
#if defined(FIRST)
structS12{
template<class>voidfoo();
template<class,class>voidfoo();
};
#elif defined(SECOND)
structS12{
template<class,class>voidfoo();
template<class>voidfoo();
};
#else
S12s12;
// expected-error@second.h:* {{'FunctionTemplate::S12' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 2 template parameters}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1 template parameter}}
#endif
#if defined(FIRST)
structS13{
template<class=int>voidfoo();
};
#elif defined(SECOND)
structS13{
template<class=void>voidfoo();
};
#else
S13s13;
// expected-error@second.h:* {{'FunctionTemplate::S13' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with default argument 'void'}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument 'int'}}
#endif
#if defined(FIRST)
structS14{
template<class=void>voidfoo();
};
#elif defined(SECOND)
structS14{
template<class>voidfoo();
};
#else
S14s14;
// expected-error@second.h:* {{'FunctionTemplate::S14' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with no default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument}}
#endif
#if defined(FIRST)
structS15{
template<class>voidfoo();
};
#elif defined(SECOND)
structS15{
template<class=void>voidfoo();
};
#else
S15s15;
// expected-error@second.h:* {{'FunctionTemplate::S15' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with no default argument}}
#endif
#if defined(FIRST)
structS16{
template<short>voidfoo();
};
#elif defined(SECOND)
structS16{
template<short=1>voidfoo();
};
#else
S16s16;
// expected-error@second.h:* {{'FunctionTemplate::S16' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with no default argument}}
#endif
#if defined(FIRST)
structS17{
template<short=2>voidfoo();
};
#elif defined(SECOND)
structS17{
template<short=1+1>voidfoo();
};
#else
S17s17;
// expected-error@second.h:* {{'FunctionTemplate::S17' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with default argument 1 + 1}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with default argument 2}}
#endif
#if defined(FIRST)
structS18{
template<short>voidfoo();
template<int>voidfoo();
};
#elif defined(SECOND)
structS18{
template<int>voidfoo();
template<short>voidfoo();
};
#else
S18s18;
// expected-error@second.h:* {{'FunctionTemplate::S18' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter with one type}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter with different type}}
#endif
#if defined(FIRST)
structS19{
template<short>voidfoo();
template<short...>voidfoo();
};
#elif defined(SECOND)
structS19{
template<short...>voidfoo();
template<short>voidfoo();
};
#else
S19s19;
// expected-error@second.h:* {{'FunctionTemplate::S19' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter being a template parameter pack}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter not being a template parameter pack}}
#endif
#if defined(FIRST)
structS20{
template<class>voidfoo();
template<class...>voidfoo();
};
#elif defined(SECOND)
structS20{
template<class...>voidfoo();
template<class>voidfoo();
};
#else
S20s20;
// expected-error@second.h:* {{'FunctionTemplate::S20' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter being a template parameter pack}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter not being a template parameter pack}}
#endif
#if defined(FIRST)
structS21{
template<template<class>class...>voidfoo();
template<template<class>class>voidfoo();
};
#elif defined(SECOND)
structS21{
template<template<class>class>voidfoo();
template<template<class>class...>voidfoo();
};
#else
S21s21;
// expected-error@second.h:* {{'FunctionTemplate::S21' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter not being a template parameter pack}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template parameter being a template parameter pack}}
#endif
#if defined(FIRST)
structS22{
template<template<class>class>voidfoo();
template<class>voidfoo();
template<int>voidfoo();
};
#elif defined(SECOND)
structS22{
template<class>voidfoo();
template<int>voidfoo();
template<template<class>class>voidfoo();
};
#else
S22s22;
// expected-error@second.h:* {{'FunctionTemplate::S22' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter being a type template parameter}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template paramter being a template template parameter}}
#endif
#if defined(FIRST)
structS23{
template<class>voidfoo();
template<int>voidfoo();
template<template<class>class>voidfoo();
};
#elif defined(SECOND)
structS23{
template<int>voidfoo();
template<template<class>class>voidfoo();
template<class>voidfoo();
};
#else
S23s23;
// expected-error@second.h:* {{'FunctionTemplate::S23' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter being a non-type template parameter}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template paramter being a type template parameter}}
#endif
#if defined(FIRST)
structS24{
template<int>voidfoo();
template<template<class>class>voidfoo();
template<class>voidfoo();
};
#elif defined(SECOND)
structS24{
template<template<class>class>voidfoo();
template<class>voidfoo();
template<int>voidfoo();
};
#else
S24s24;
// expected-error@second.h:* {{'FunctionTemplate::S24' has different definitions in different modules; first difference is definition in module 'SecondModule' found function template 'foo' with 1st template parameter being a template template parameter}}
// expected-note@first.h:* {{but in 'FirstModule' found function template 'foo' with 1st template paramter being a non-type template parameter}}
#endif
#if defined(FIRST)
structS25{
template<int>voidfoo();
};
#elif defined(SECOND)
structS25{
public:
template<int>voidfoo();
};
#else
S25s25;
// expected-error@second.h:* {{'FunctionTemplate::S25' 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 function template}}
#endif
#define DECLS \
template<int> \
voidnontype1(); \
template<intx> \
voidnontype2(); \
template<int,int> \
voidnontype3(); \
template<intx=5> \
voidnontype4(); \
template<int...x> \
voidnontype5(); \
\
template<class> \
voidtype1(); \
template<classx> \
voidtype2(); \
template<class,class> \
voidtype3(); \
template<classx=int> \
voidtype4(); \
template<class...x> \
voidtype5(); \
\
template<template<int>class> \
voidtemplate1(); \
template<template<int>classx> \
voidtemplate2(); \
template<template<int>class,template<int>class> \
voidtemplate3(); \
template<template<int>classx=U> \
voidtemplate4(); \
template<template<int>class...x> \
voidtemplate5();
#if defined(FIRST) || defined(SECOND)
template<int>
structU{};
structValid1{
DECLS
};
#else
Valid1v1;
#endif
#if defined(FIRST) || defined(SECOND)
structInvalid1{
DECLS
ACCESS
};
#else
Invalid1i1;
// expected-error@second.h:* {{'FunctionTemplate::Invalid1' 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@first.h:* {{'Enums::x11' from module 'FirstModule' is not present in definition of 'Enums::E1' in module 'SecondModule'}}
// expected-note@second.h:* {{definition has no member 'x11'}}
#endif
#if defined(FIRST)
enumE2{};
#elif defined(SECOND)
enumE2{x21};
#else
E2e2;
// expected-error@second.h:* {{'Enums::E2' has different definitions in different modules; definition in module 'SecondModule' first difference is enum with 1 element}}
// expected-note@first.h:* {{but in 'FirstModule' found enum with 0 elements}}
#endif
#if defined(FIRST)
enumE3{x31};
#elif defined(SECOND)
enumE3{x32};
#else
E3e3;
// expected-error@first.h:* {{'Enums::x31' from module 'FirstModule' is not present in definition of 'Enums::E3' in module 'SecondModule'}}
// expected-note@second.h:* {{definition has no member 'x31'}}
#endif
#if defined(FIRST)
enumE4{x41};
#elif defined(SECOND)
enumE4{x41,x42};
#else
E4e4;
// expected-error@second.h:* {{'Enums::E4' has different definitions in different modules; definition in module 'SecondModule' first difference is enum with 2 elements}}
// expected-note@first.h:* {{but in 'FirstModule' found enum with 1 element}}
#endif
#if defined(FIRST)
enumE5{x51,x52};
#elif defined(SECOND)
enumE5{x51};
#else
E5e5;
// expected-error@first.h:* {{'Enums::x52' from module 'FirstModule' is not present in definition of 'Enums::E5' in module 'SecondModule'}}
// expected-note@second.h:* {{definition has no member 'x52'}}
#endif
#if defined(FIRST)
enumE6{x61,x62};
#elif defined(SECOND)
enumE6{x62,x61};
#else
E6e6;
// expected-error@second.h:* {{'Enums::E6' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element has name 'x62'}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st element has name 'x61'}}
#endif
#if defined(FIRST)
enumE7{x71=0};
#elif defined(SECOND)
enumE7{x71};
#else
E7e7;
// expected-error@second.h:* {{'Enums::E7' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element 'x71' has an initilizer}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st element 'x71' does not have an initializer}}
#endif
#if defined(FIRST)
enumE8{x81};
#elif defined(SECOND)
enumE8{x81=0};
#else
E8e8;
// expected-error@second.h:* {{'Enums::E8' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st element 'x81' does not have an initilizer}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st element 'x81' has an initializer}}
#endif
#if defined(FIRST)
enumE9{x91=0,x92=1};
#elif defined(SECOND)
enumE9{x91=0,x92=2-1};
#else
E9e9;
// expected-error@second.h:* {{'Enums::E9' has different definitions in different modules; definition in module 'SecondModule' first difference is 2nd element 'x92' has an initializer}}
// expected-note@first.h:* {{but in 'FirstModule' found 2nd element 'x92' has different initializer}}
#endif
#if defined(FIRST)
enumclassE10:int{};
#elif defined(SECOND)
enumclassE10{};
#else
E10e10;
// expected-error@second.h:* {{'Enums::E10' has different definitions in different modules; definition in module 'SecondModule' first difference is enum without specified type}}
// expected-note@first.h:* {{but in 'FirstModule' found enum with specified type}}
#endif
#if defined(FIRST)
enumE11{};
#elif defined(SECOND)
enumE11:int{};
#else
E11e11;
// expected-error@second.h:* {{'Enums::E11' has different definitions in different modules; definition in module 'SecondModule' first difference is enum with specified type}}
// expected-note@first.h:* {{but in 'FirstModule' found enum without specified type}}
#endif
#if defined(FIRST)
enumstructE12:long{};
#elif defined(SECOND)
enumstructE12:int{};
#else
E12e12;
// expected-error@second.h:* {{'Enums::E12' has different definitions in different modules; definition in module 'SecondModule' first difference is enum with specified type 'int'}}
// expected-note@first.h:* {{but in 'FirstModule' found enum with specified type 'long'}}
#endif
#if defined(FIRST)
enumstructE13{};
#elif defined(SECOND)
enumE13{};
#else
E13e13;
// expected-error@second.h:* {{'Enums::E13' has different definitions in different modules; definition in module 'SecondModule' first difference is enum that is not scoped}}
// expected-note@first.h:* {{but in 'FirstModule' found enum that is scoped}}
#endif
#if defined(FIRST)
enumE14{};
#elif defined(SECOND)
enumstructE14{};
#else
E14e14;
// expected-error@second.h:* {{'Enums::E14' has different definitions in different modules; definition in module 'SecondModule' first difference is enum that is scoped}}
// expected-note@first.h:* {{but in 'FirstModule' found enum that is not scoped}}
#endif
#if defined(FIRST)
enumclassE15{};
#elif defined(SECOND)
enumstructE15{};
#else
E15e15;
// expected-error@second.h:* {{'Enums::E15' has different definitions in different modules; definition in module 'SecondModule' first difference is enum scoped with keyword struct}}
// expected-note@first.h:* {{but in 'FirstModule' found enum scoped with keyword class}}
#endif
#if defined(FIRST)
enumstructE16{};
#elif defined(SECOND)
enumclassE16{};
#else
E16e16;
// expected-error@second.h:* {{'Enums::E16' has different definitions in different modules; definition in module 'SecondModule' first difference is enum scoped with keyword class}}
// expected-note@first.h:* {{but in 'FirstModule' found enum scoped with keyword struct}}
// expected-error@second.h:* {{'Types::Complex::invalid' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction2=valid;
#endif
}// namespace Complex
namespaceDecltype{
#if defined(FIRST)
voidinvalid1(){
decltype(1+1)x;
}
intglobal;
voidinvalid2(){
decltype(global)x;
}
voidvalid(){
decltype(1.5)x;
decltype(x)y;
}
#elif defined(SECOND)
voidinvalid1(){
decltype(2)x;
}
floatglobal;
voidinvalid2(){
decltype(global)x;
}
voidvalid(){
decltype(1.5)x;
decltype(x)y;
}
#else
autofunction1=invalid1;
// expected-error@second.h:* {{'Types::Decltype::invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction2=invalid2;
// expected-error@second.h:* {{'Types::Decltype::invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction3=valid;
#endif
}// namespace Decltype
namespaceAuto{
#if defined(FIRST)
voidinvalid1(){
decltype(auto)x=1;
}
voidinvalid2(){
autox=1;
}
voidinvalid3(){
__auto_typex=1;
}
voidvalid(){
decltype(auto)x=1;
autoy=1;
__auto_typez=1;
}
#elif defined(SECOND)
voidinvalid1(){
autox=1;
}
voidinvalid2(){
__auto_typex=1;
}
voidinvalid3(){
decltype(auto)x=1;
}
voidvalid(){
decltype(auto)x=1;
autoy=1;
__auto_typez=1;
}
#else
autofunction1=invalid1;
// expected-error@second.h:* {{'Types::Auto::invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction2=invalid3;
// expected-error@second.h:* {{'Types::Auto::invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction3=invalid2;
// expected-error@second.h:* {{'Types::Auto::invalid3' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction4=valid;
#endif
}// namespace Auto
namespaceDeducedTemplateSpecialization{
#if defined(FIRST)
template<typenameT>structA{};
A()->A<int>;
template<typenameT>structB{};
B()->B<int>;
voidinvalid1(){
Aa{};
}
voidinvalid2(){
Aa{};
}
voidvalid(){
Bb{};
}
#elif defined(SECOND)
template<typenameT>structA{};
A()->A<float>;
template<typenameT>structB{};
B()->B<int>;
voidinvalid1(){
Aa{};
}
voidinvalid2(){
Ba{};
}
voidvalid(){
Bb{};
}
#else
autofunction1=invalid1;
// expected-error@second.h:* {{'Types::DeducedTemplateSpecialization::invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction2=invalid2;
// expected-error@second.h:* {{'Types::DeducedTemplateSpecialization::invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
// expected-error@first.h:* {{'Types::DependentAddressSpace::invalid1' has different definitions in different modules; definition in module 'FirstModule' first difference is function body}}
// expected-note@second.h:* {{but in 'SecondModule' found a different body}}
staticautofunction2=invalid2<B>;
// expected-error@first.h:* {{'Types::DependentAddressSpace::invalid2' has different definitions in different modules; definition in module 'FirstModule' first difference is function body}}
// expected-note@second.h:* {{but in 'SecondModule' found a different body}}
// expected-error@first.h:* {{'Types::DependentSizedExtVector::invalid1' has different definitions in different modules; definition in module 'FirstModule' first difference is function body}}
// expected-note@second.h:* {{but in 'SecondModule' found a different body}}
staticautoFunction2=invalid2<Num>;
// expected-error@first.h:* {{'Types::DependentSizedExtVector::invalid2' has different definitions in different modules; definition in module 'FirstModule' first difference is function body}}
// expected-note@second.h:* {{but in 'SecondModule' found a different body}}
staticautoFunction3=valid<Num>;
};
#endif
}// namespace DependentSizedExtVector
namespaceInjectedClassName{
#if defined(FIRST)
structInvalid{
template<int>
structL2{
template<int>
structL3{
L3*x;
};
};
};
structValid{
template<int>
structL2{
template<int>
structL3{
L2*x;
L3*y;
};
};
};
#elif defined(SECOND)
structInvalid{
template<int>
structL2{
template<int>
structL3{
L2*x;
};
};
};
structValid{
template<int>
structL2{
template<int>
structL3{
L2*x;
L3*y;
};
};
};
#else
Invalid::L2<1>::L3<1>invalid;
// expected-error@second.h:* {{'Types::InjectedClassName::Invalid::L2::L3::x' from module 'SecondModule' is not present in definition of 'L3<>' in module 'FirstModule'}}
// expected-note@first.h:* {{declaration of 'x' does not match}}
Valid::L2<1>::L3<1>valid;
#endif
}// namespace InjectedClassName
namespaceMemberPointer{
#if defined(FIRST)
structA{};
structB{};
voidInvalid1(){
intA::*x;
};
voidInvalid2(){
intA::*x;
}
voidInvalid3(){
int(A::*x)(int);
}
voidValid(){
intA::*x;
floatA::*y;
boolB::*z;
void(A::*fun1)();
int(A::*fun2)();
void(B::*fun3)(int);
void(B::*fun4)(bool*,int);
}
#elif defined(SECOND)
structA{};
structB{};
voidInvalid1(){
floatA::*x;
};
voidInvalid2(){
intB::*x;
}
voidInvalid3(){
int(A::*x)(int,int);
}
voidValid(){
intA::*x;
floatA::*y;
boolB::*z;
void(A::*fun1)();
int(A::*fun2)();
void(B::*fun3)(int);
void(B::*fun4)(bool*,int);
}
#else
autofunction1=Invalid1;
// expected-error@second.h:* {{'Types::MemberPointer::Invalid1' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction2=Invalid2;
// expected-error@second.h:* {{'Types::MemberPointer::Invalid2' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction3=Invalid3;
// expected-error@second.h:* {{'Types::MemberPointer::Invalid3' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
autofunction4=Valid;
#endif
}// namespace MemberPointer
namespacePackExpansion{
#if defined(FIRST)
structInvalid{
template<class...A>
structL2{
template<class...B>
structL3{
voidrun(A...);
voidrun(B...);
};
};
};
structValid{
template<class...A>
structL2{
template<class...B>
structL3{
voidrun(A...);
voidrun(B...);
};
};
};
#elif defined(SECOND)
structInvalid{
template<class...A>
structL2{
template<class...B>
structL3{
voidrun(B...);
voidrun(A...);
};
};
};
structValid{
template<class...A>
structL2{
template<class...B>
structL3{
voidrun(A...);
voidrun(B...);
};
};
};
#else
Invalid::L2<int>::L3<short,bool>invalid;
// expected-error@first.h:* {{'Types::PackExpansion::Invalid::L2::L3' has different definitions in different modules; first difference is definition in module 'FirstModule' found method 'run' with 1st parameter of type 'A...'}}
// expected-note@second.h:* {{but in 'SecondModule' found method 'run' with 1st parameter of type 'B...'}}
Valid::L2<int>::L3<short,bool>valid;
#endif
}// namespace PackExpansion
namespaceParen{
#if defined(FIRST)
voidinvalid(){
int(*x);
}
voidvalid(){
int(*x);
}
#elif defined(SECOND)
voidinvalid(){
float(*x);
}
voidvalid(){
int(*x);
}
#else
autofunction1=invalid;
// expected-error@second.h:* {{'Types::Paren::invalid' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
// expected-error@first.h:* {{'Types::UnaryTransform::Invalid1::x' from module 'FirstModule' is not present in definition of 'Types::UnaryTransform::Invalid1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
Invalid2i2;
// expected-error@second.h:* {{'Types::UnaryTransform::Invalid2' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E2b)' (aka 'unsigned int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E2a)' (aka 'unsigned int')}}
Invalid3i3;
// expected-error@first.h:* {{'Types::UnaryTransform::Invalid3::x' from module 'FirstModule' is not present in definition of 'Types::UnaryTransform::Invalid3' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
Invalid4i4;
// expected-error@second.h:* {{'Types::UnaryTransform::Invalid4' has different definitions in different modules; first difference is definition in module 'SecondModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E4b)' (aka 'unsigned int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type '__underlying_type(Types::UnaryTransform::E4a)' (aka 'unsigned int')}}
Valid1v1;
Valid2v2;
Valid3v3;
#endif
}// namespace UnaryTransform
namespaceUnresolvedUsing{
#if defined(FIRST)
template<classT>structwrapper{};
template<classT>
structInvalid{
usingtypenamewrapper<T>::T1;
usingtypenamewrapper<T>::T2;
T1x;
};
template<classT>
structValid{
usingtypenamewrapper<T>::T1;
usingtypenamewrapper<T>::T2;
T1x;
T2y;
};
#elif defined(SECOND)
template<classT>structwrapper{};
template<classT>
structInvalid{
usingtypenamewrapper<T>::T1;
usingtypenamewrapper<T>::T2;
T2x;
};
template<classT>
structValid{
usingtypenamewrapper<T>::T1;
usingtypenamewrapper<T>::T2;
T1x;
T2y;
};
#else
template<classT>usingI=Invalid<T>;
// expected-error@first.h:* {{'Types::UnresolvedUsing::Invalid::x' from module 'FirstModule' is not present in definition of 'Invalid<T>' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// 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}}
// 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}}
// expected-error@second.h:* {{'DefaultArguments::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}}
// expected-error@second.h:* {{'DefaultArguments::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:* {{'FunctionDecl::F4' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with name 'y'}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with name 'x'}}
#endif
#if defined(FIRST)
intF5(intx){return1;}
#elif defined(SECOND)
intF5(intx=1){return1;}
#else
intI5=F6(1);
// expected-error@second.h:* {{'FunctionDecl::F5' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter without a default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with a default argument}}
#endif
#if defined(FIRST)
intF6(intx=2){return1;}
#elif defined(SECOND)
intF6(intx=1){return1;}
#else
intI6=F6(1);
// expected-error@second.h:* {{'FunctionDecl::F6' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with a default argument}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with a different default argument}}
#endif
usingI=int;
#if defined(FIRST)
IF7(){return0;}
#elif defined(SECOND)
intF7(){return0;}
#else
intI7=F7();
// expected-error@second.h:* {{'FunctionDecl::F7' has different definitions in different modules; definition in module 'SecondModule' first difference is return type is 'int'}}
// expected-note@first.h:* {{but in 'FirstModule' found different return type 'FunctionDecl::I' (aka 'int')}}
#endif
#if defined(FIRST)
intF8(int){return0;}
#elif defined(SECOND)
intF8(I){return0;}
#else
intI8=F8(1);
// expected-error@second.h:* {{'FunctionDecl::F8' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with type 'FunctionDecl::I' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with type 'int'}}
#endif
#if defined(FIRST)
intF9(int[1]){return0;}
#elif defined(SECOND)
intF9(int[2]){return0;}
#else
intI9=F9(nullptr);
// expected-error@second.h:* {{'FunctionDecl::F9' has different definitions in different modules; definition in module 'SecondModule' first difference is 1st parameter with type 'int *' decayed from 'int [2]'}}
// expected-note@first.h:* {{but in 'FirstModule' found 1st parameter with type 'int *' decayed from 'int [1]'}}
#endif
#if defined(FIRST)
intF10(){return1;}
#elif defined(SECOND)
intF10(){return2;}
#else
intI10=F10();
#endif
// expected-error@second.h:* {{'FunctionDecl::F10' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}
// expected-error@second.h:* {{'DeclTemplateArguments::bar' has different definitions in different modules; definition in module 'SecondModule' first difference is function body}}
// expected-note@first.h:* {{but in 'FirstModule' found a different body}}