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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116429 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/member-pointer.cpp b/test/SemaCXX/member-pointer.cpp
index 795c0b9..31c651a 100644
--- a/test/SemaCXX/member-pointer.cpp
+++ b/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