Hi John,

I think this is causing a crash on a couple of bots:

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-RA/builds/6937/steps/make/logs/stdio
http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-DA/builds/6943/steps/make/logs/stdio

Could you take a look? Thanks.

John McCall <[email protected]> writes:
> Author: rjmccall
> Date: Wed May 14 02:54:17 2014
> New Revision: 208756
>
> URL: http://llvm.org/viewvc/llvm-project?rev=208756&view=revLog:
> Create a redeclaration when an elaborated type specifier
> resolves to an existing declaration if there are attributes
> present.
>
> This gives us something to apply the attributes to.
>
> Modified:
>     cfe/trunk/lib/Sema/SemaDecl.cpp
>     cfe/trunk/test/Sema/struct-decl.c
>
> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=208756&r1=208755&r2=208756&view=diff==============================================================================
> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed May 14 02:54:17 2014
> @@ -10919,14 +10919,17 @@ Decl *Sema::ActOnTag(Scope *S, unsigned
>          }
>  
>          if (!Invalid) {
> -          // If this is a use, just return the declaration we found.
> +          // If this is a use, just return the declaration we found, unless
> +          // we have attributes.
>  
>            // FIXME: In the future, return a variant or some other clue
>            // for the consumer of this Decl to know it doesn't own it.
>            // For our current ASTs this shouldn't be a problem, but will
>            // need to be changed with DeclGroups.
> -          if ((TUK == TUK_Reference && (!PrevTagDecl->getFriendObjectKind() 
> ||
> -               getLangOpts().MicrosoftExt)) || TUK == TUK_Friend)
> +          if (!Attr &&
> +              ((TUK == TUK_Reference &&
> +                (!PrevTagDecl->getFriendObjectKind() || 
> getLangOpts().MicrosoftExt))
> +               || TUK == TUK_Friend))
>              return PrevTagDecl;
>  
>            // Diagnose attempts to redefine a tag.
>
> Modified: cfe/trunk/test/Sema/struct-decl.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/struct-decl.c?rev=208756&r1=208755&r2=208756&view=diff==============================================================================
> --- cfe/trunk/test/Sema/struct-decl.c (original)
> +++ cfe/trunk/test/Sema/struct-decl.c Wed May 14 02:54:17 2014
> @@ -66,3 +66,6 @@ void test_hiding() {
>    struct hiding_1 *p = hiding_1();
>    struct hiding_2 *q = hiding_2;
>  }
> +
> +struct PreserveAttributes {};
> +typedef struct __attribute__((noreturn)) PreserveAttributes 
> PreserveAttributes_t; // expected-warning {{'noreturn' attribute only applies 
> to functions and methods}}
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to