[cfe-commits] r98698 - in /cfe/trunk: include/clang/Parse/Action.h lib/Parse/ParseDeclCXX.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp

John McCall rjmccall at apple.com
Wed Mar 17 12:26:58 PDT 2010


On Mar 17, 2010, at 9:43 AM, Benjamin Kramer wrote:

> 
> On 17.03.2010, at 01:38, John McCall wrote:
> 
>> Author: rjmccall
>> Date: Tue Mar 16 19:38:33 2010
>> New Revision: 98698
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=98698&view=rev
>> Log:
>> Clean up after ourselves when there's an error parsing the base clause.
>> Fixes the crash-on-invalid in PR6629.
> […]
>> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=98698&r1=98697&r2=98698&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
>> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Mar 16 19:38:33 2010
>> @@ -5118,6 +5118,18 @@
>>  Consumer.HandleTagDeclDefinition(Tag);
>> }
>> 
>> +void Sema::ActOnTagDefinitionError(Scope *S, DeclPtrTy TagD) {
>> +  AdjustDeclIfTemplate(TagD);
>> +  TagDecl *Tag = cast<TagDecl>(TagD.getAs<Decl>());
>> +
>> +  Tag->setInvalidDecl();
>> +
>> +  if (isa<CXXRecordDecl>(Tag))
>> +    FieldCollector->FinishClass();
>> +
>> +  PopDeclContext();  
>> +}
> 
> Hi John,
> 
> There is a bug in this code that surfaces in SemaCXX/class.cpp on the msvc buildbot.
> It can be seen on other platforms with the assert in the attached patch.
> 
> <98698.patch>

Argh, thanks.  Fixed in 98760.

John.



More information about the cfe-commits mailing list