[cfe-commits] r98698 - in /cfe/trunk: include/clang/Parse/Action.h lib/Parse/ParseDeclCXX.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp
Benjamin Kramer
benny.kra at googlemail.com
Wed Mar 17 09:43:16 PDT 2010
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 98698.patch
Type: application/octet-stream
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100317/e4d7fe58/attachment.obj>
More information about the cfe-commits
mailing list