[PATCH] D13925: Implement __attribute__((internal_linkage))

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 11:26:19 PST 2015


On Wed, Nov 4, 2015 at 2:20 PM, Evgeniy Stepanov <eugenis at google.com> wrote:
> eugenis added a comment.
>
> Hm, the current implementation allows all of the following:
>
> void f(int a [[clang::internal_linkage]]) {  // 1
>
>   int b [[clang::internal_linkage]];   // 2
>   static int c [[clang::internal_linkage]];  // 3
>
> }
>
> I'll fix (1). Is it OK to allow (2) and (3)? The attribute has no effect because the declarations already have internal linkage, so I'd say it behaves as documented.

I would prefer (2) and (3) to at least warn that the attribute has no
effect (and not attach the attribute to the decl). This is consistent
with the way other attributes behave.

~Aaron

>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D13925
>
>
>


More information about the cfe-commits mailing list