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

Jeffrey Yasskin jyasskin at google.com
Wed Apr 7 22:40:38 PDT 2010


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.

Please take a look,
Jeffrey



More information about the cfe-commits mailing list