r185446 - Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Jul 2 11:21:55 PDT 2013


You can use -emit-llvm-only.

On Tuesday, July 2, 2013, Serge Pavlov wrote:

> Author: sepavloff
> Date: Tue Jul  2 12:31:56 2013
> New Revision: 185446
>
> URL: http://llvm.org/viewvc/llvm-project?rev=185446&view=rev
> Log:
> Fix to PR15826 - clang hits assert in
> clang::ASTContext::getASTRecordLayout.
>
> Added:
>     cfe/trunk/test/CodeGen/PR15826.c
> Modified:
>     cfe/trunk/lib/Sema/SemaDecl.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=185446&r1=185445&r2=185446&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Jul  2 12:31:56 2013
> @@ -10483,7 +10483,8 @@ void Sema::ActOnTagFinishDefinition(Scop
>      Tag->setTopLevelDeclInObjCContainer();
>
>    // Notify the consumer that we've defined a tag.
> -  Consumer.HandleTagDeclDefinition(Tag);
> +  if (!Tag->isInvalidDecl())
> +    Consumer.HandleTagDeclDefinition(Tag);
>  }
>
>  void Sema::ActOnObjCContainerFinishDefinition() {
>
> Added: cfe/trunk/test/CodeGen/PR15826.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/PR15826.c?rev=185446&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/PR15826.c (added)
> +++ cfe/trunk/test/CodeGen/PR15826.c Tue Jul  2 12:31:56 2013
> @@ -0,0 +1,19 @@
> +// RUN: %clang_cc1 -verify -emit-llvm %s
> +
> +/* Testcase for PR15826 - clang hits assert in
> clang::ASTContext::getASTRecordLayout */
> +struct sysctl_req {
> +  struct aiocblist *p_aio;
> +};
> +
> +struct sysctl_oid {
> +  int (*oid_handler)(struct sysctl_req *req);
> +};
> +
> +static struct sysctl_oid sysctl___kern_features_aio;
> +
> +static void const *const __set_sysctl_set_sym_sysctl___kern_features_aio
> +    __attribute__((__used__)) = &sysctl___kern_features_aio;
> +
> +struct aiocblist {
> +  struct aiocb uaiocb; // expected-error {{field has incomplete type}}
> expected-note {{forward declaration}}
> +};
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu <javascript:;>
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130702/6013756a/attachment.html>


More information about the cfe-commits mailing list