// 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 'B' (aka 'int')}}
// expected-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'A' (aka 'int')}}
S5s5;
// 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-note@first.h:* {{but in 'FirstModule' found field 'x' with type 'A' (aka '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:* {{'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}}