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.

Attachment: 98698.patch
Description: Binary data

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

Reply via email to