// expected-error@second.h:* {{Types::Attributed::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}}
auto function2 = invalid2;
// expected-error@second.h:* {{'Types::Attributed::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}}
auto function3 = valid;
#endif
} // namespace Attributed
namespace BlockPointer {
#if defined(FIRST)
void invalid1() {
void (^x)(int);
}
void invalid2() {
void (^x)(int);
}
void invalid3() {
void (^x)(int);
}
void invalid4() {
void (^x)(int);
}
void valid() {
void (^x1)(int);
int (^x2)(int);
void (^x3)(int, int);
void (^x4)(short);
}
#elif defined(SECOND)
void invalid1() {
void (^x)();
}
void invalid2() {
void (^x)(int, int);
}
void invalid3() {
int (^x)(int);
}
void invalid4() {
void (^x)(float);
}
void valid() {
void (^x1)(int);
int (^x2)(int);
void (^x3)(int, int);
void (^x4)(short);
}
#else
auto function1 = invalid1;
// expected-error@second.h:* {{'Types::BlockPointer::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}}
auto function2 = invalid2;
// expected-error@second.h:* {{'Types::BlockPointer::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}}
auto function3 = invalid3;
// expected-error@second.h:* {{'Types::BlockPointer::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}}
auto function4 = invalid4;
// expected-error@second.h:* {{'Types::BlockPointer::invalid4' 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}}
auto function5 = valid;
#endif
} // namespace BlockPointer
namespace ObjCObject {
#if defined(FIRST)
struct Invalid1 {
using T = Interface2<I1*>;
};
struct Invalid2 {
using T = Interface2<I1*>;
};
struct Invalid3 {
using T = Interface2<P1, P1>;
};
struct Invalid4 {
using T = Interface2<P1>;
};
struct Valid {
using T1 = Interface2<I1*>;
using T2 = Interface3<I1*>;
using T3 = Interface2<P1>;
using T4 = Interface3<P1, P2>;
using T5 = __kindof Interface2;
};
#elif defined(SECOND)
struct Invalid1 {
using T = Interface3<I1*>;
};
struct Invalid2 {
using T = Interface2<I2*>;
};
struct Invalid3 {
using T = Interface2<P1>;
};
struct Invalid4 {
using T = Interface2<P2>;
};
struct Valid {
using T1 = Interface2<I1*>;
using T2 = Interface3<I1*>;
using T3 = Interface2<P1>;
using T4 = Interface3<P1, P2>;
using T5 = __kindof Interface2;
};
#else
Invalid1 i1;
// expected-error@first.h:* {{'Types::ObjCObject::Invalid1::T' from module 'FirstModule' is not present in definition of 'Types::ObjCObject::Invalid1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'T' does not match}}
Invalid2 i2;
// expected-error@first.h:* {{'Types::ObjCObject::Invalid2::T' from module 'FirstModule' is not present in definition of 'Types::ObjCObject::Invalid2' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'T' does not match}}
Invalid3 i3;
// expected-error@second.h:* {{'Types::ObjCObject::Invalid3' has different definitions in different modules; first difference is definition in module 'SecondModule' found type alias 'T' with underlying type 'Interface2<P1>'}}
// expected-note@first.h:* {{but in 'FirstModule' found type alias 'T' with different underlying type 'Interface2<P1,P1>'}}
Invalid4 i4;
// expected-error@first.h:* {{'Types::ObjCObject::Invalid4::T' from module 'FirstModule' is not present in definition of 'Types::ObjCObject::Invalid4' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'T' does not match}}
Valid v;
#endif
} // namespace VisitObjCObject
} // namespace Types
#if defined(FIRST)
@interface Interface4 <T : I1 *> {
@public
T<P1> x;
}
@end
@interface Interface5 <T : I1 *> {
@public
T<P1> x;
}
@end
@interface Interface6 <T1 : I1 *, T2 : I2 *> {
@public
T1 x;
}
@end
#elif defined(SECOND)
@interface Interface4 <T : I1 *> {
@public
T<P2> x;
}
@end
@interface Interface5 <T : I1 *> {
@public
T<P1, P2> x;
}
@end
@interface Interface6 <T1 : I1 *, T2 : I2 *> {
@public
T2 x;
}
@end
#endif
namespace Types {
namespace ObjCTypeParam {
#if defined(FIRST) || defined(SECOND)
struct Invalid1 {
Interface4 *I;
decltype(I->x) x;
};
struct Invalid2 {
Interface5 *I;
decltype(I->x) x;
};
struct Invalid3 {
Interface6 *I;
decltype(I->x) x;
};
#else
Invalid1 i1;
// expected-error@first.h:* {{'Types::ObjCTypeParam::Invalid1::x' from module 'FirstModule' is not present in definition of 'Types::ObjCTypeParam::Invalid1' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
Invalid2 i2;
// expected-error@first.h:* {{'Types::ObjCTypeParam::Invalid2::x' from module 'FirstModule' is not present in definition of 'Types::ObjCTypeParam::Invalid2' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
Invalid3 i3;
// expected-error@first.h:* {{'Types::ObjCTypeParam::Invalid3::x' from module 'FirstModule' is not present in definition of 'Types::ObjCTypeParam::Invalid3' in module 'SecondModule'}}
// expected-note@second.h:* {{declaration of 'x' does not match}}
// expected-error@second.h:* {{'CallMethods::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}}
// expected-error@second.h:* {{'CallMethods::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}}