[PATCH] Do not assert when dereferencing member pointer using virtual inheritance with an incomplete class type
Reid Kleckner
rnk at google.com
Thu Feb 20 13:40:46 PST 2014
LGTM
I guess it would be hard to avoid diagnosing this code if we did the check in Sema:
struct __virtual_inheritance A;
int foo(A *a, int A::*mp) {
return a->*mp;
}
struct B {};
struct A : virtual B {
int a;
};
And it's a super special case since you have to use __virtual_inheritance, not __multiple_inheritance or some other.
================
Comment at: test/CodeGenCXX/microsoft-abi-member-pointers.cpp:565
@@ +564,3 @@
+int foo(A *a, int A::*mp) {
+ return a->*mp; // expected-error{{requires a complete class type}}
+}
----------------
I'd test member function pointers too, just for completeness.
http://llvm-reviews.chandlerc.com/D2842
More information about the cfe-commits
mailing list