[cfe-commits] Patch to make CXXScopeSpecs invalid when they refer to incomplete classes

John McCall rjmccall at apple.com
Thu Apr 8 01:56:31 PDT 2010


On Apr 7, 2010, at 10:40 PM, Jeffrey Yasskin wrote:

> On Mon, Apr 5, 2010 at 7:09 AM, Douglas Gregor <dgregor at apple.com> wrote:
>> Hi Jeffrey,
>> 
>> On Apr 5, 2010, at 1:19 AM, Jeffrey Yasskin wrote:
>> 
>>> I have a patch at http://codereview.appspot.com/890041 which has
>>> Sema::RequireCompleteDeclContext(CXXScopeSpec &SS) mark SS as invalid
>>> when it refers to an incomplete type. It's pretty ugly because it
>>> makes lots of parameters non-const, and it breaks one test in way I'm
>>> not sure how to fix, but it also removes several redundant errors.
>>> 
>>> Is this the right approach to avoid diagnosing "invalid_type::foo"
>>> multiple times? If so, I'll track down the temp.explicit/p3.cpp
>>> failure and mail the working patch. Otherwise, what's the better way
>>> to fix it?
>> 
>> Yes, this is the right approach to avoid multiply diagnostics when the nested-name-specifier has an incomplete type. Thanks for working on this!
>> 
> 
> Ok, this is ready to review at
> http://codereview.appspot.com/download/issue890041_2001.diff or
> http://codereview.appspot.com/890041. I fixed the test by marking
> Declarators invalid just after the ParseUnqualifiedId() call in
> ParseDirectDeclarator(), when their CXXScopeSpec is invalid.

This looks good.  Thanks for doing this!

John.





More information about the cfe-commits mailing list