There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even
though the standard requires it. GCC/EDG do not require a complete
type here, so we're calling this a problem with the standard. Fixes
PR8328.
llvm-svn: 116429
diff --git a/clang/test/SemaCXX/member-pointer.cpp b/clang/test/SemaCXX/member-pointer.cpp
index 795c0b9..31c651a 100644
--- a/clang/test/SemaCXX/member-pointer.cpp
+++ b/clang/test/SemaCXX/member-pointer.cpp
@@ -88,7 +88,7 @@
void (HasMembers::*pmd)() = &HasMembers::d;
}
-struct Incomplete; // expected-note {{forward declaration}}
+struct Incomplete;
void h() {
HasMembers hm, *phm = &hm;
@@ -121,9 +121,10 @@
(void)(hm.*i); // expected-error {{pointer-to-member}}
(void)(phm->*i); // expected-error {{pointer-to-member}}
+ // Okay
Incomplete *inc;
int Incomplete::*pii = 0;
- (void)(inc->*pii); // expected-error {{pointer into incomplete}}
+ (void)(inc->*pii);
}
struct OverloadsPtrMem
diff --git a/clang/test/SemaTemplate/instantiate-complete.cpp b/clang/test/SemaTemplate/instantiate-complete.cpp
index c13930d..91d4d32 100644
--- a/clang/test/SemaTemplate/instantiate-complete.cpp
+++ b/clang/test/SemaTemplate/instantiate-complete.cpp
@@ -11,8 +11,7 @@
// expected-error{{data member instantiated with function type 'int (int)'}} \
// expected-error{{data member instantiated with function type 'char (char)'}} \
// expected-error{{data member instantiated with function type 'short (short)'}} \
- // expected-error{{data member instantiated with function type 'float (float)'}} \
- // expected-error{{data member instantiated with function type 'long (long)'}}
+ // expected-error{{data member instantiated with function type 'float (float)'}}
};
X<int> f() { return 0; }
@@ -44,7 +43,6 @@
X<long(long)> *p2,
long (X<long(long)>::*pm2)(long)) {
(void)(p1->*pm1);
- (void)((p2->*pm2)(0)); // expected-note{{in instantiation of template class 'X<long (long)>' requested here}}
}
// Reference binding to a base