On Aug 15, 2010, at 6:58 PM, Eli Friedman wrote:

> On Sun, Aug 15, 2010 at 6:16 PM, Charles Davis <[email protected]> 
> wrote:
>> On 8/15/10 12:34 AM, Eli Friedman wrote:
>>> It would be nice to add the appropriate warning about constructing a
>>> member pointer to an incomplete type along with this... otherwise we
>>> can end up silently generating bad code.
>> It would be, but I don't know how to issue a diagnostic from the AST
>> library, so I've left that out for now.
> 
> Erm, I was thinking more along the lines of tossing a call to
> RequireCompleteType into Sema::BuildMemberPointerType in SemaType.cpp
> if we're using the MS ABI.  That should be a separate patch, though...

We definitely need a RequireCompleteType here in MS mode — if nothing
else, to force instantiation.  MSVC does permit the base to be an incomplete
type (falling back to the maximally general 8-byte representation), so if we 
want
to be perfectly compatible we'll eventually need to pass an empty PDiag.  For
now, though, we should probably just forbid it so that we can audit use cases
instead of silently compiling them differently from MSVC.  Hopefully it's not 
being
used in system headers.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to