classes is a template argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209190
91177308-0d34-0410-b5e6-
96231b3b80d8
if (FromType->isMemberPointerType() && ToType->isMemberPointerType()) {
const MemberPointerType *FromMember = FromType->getAs<MemberPointerType>(),
*ToMember = ToType->getAs<MemberPointerType>();
- if (FromMember->getClass() != ToMember->getClass()) {
+ if (FromMember->getClass()->getCanonicalTypeInternal() !=
+ ToMember->getClass()->getCanonicalTypeInternal()) {
PDiag << ft_different_class << QualType(ToMember->getClass(), 0)
<< QualType(FromMember->getClass(), 0);
return;
const float4 V = (float4){ in, out };
// expected-error@-1{{cannot initialize a compound literal initializer}}
}
+
+namespace template_test {
+class S {
+public:
+ void foo(int);
+};
+
+template <class P> struct S2 {
+ void (P::*a)(const int &);
+};
+
+void test_15() {
+ S2<S> X = {&S::foo};
+ // expected-error@-1{{cannot initialize a member subobject of type 'void (template_test::S::*)(const int &)' with an rvalue of type 'void (template_test::S::*)(int)': type mismatch at 1st parameter ('const int &' vs 'int')}}
+}
+}