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

Evgeniy Stepanov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 28 12:06:30 PDT 2015

eugenis added a comment.

In http://reviews.llvm.org/D13925#276626, @majnemer wrote:

> No diagnostic is issued for the following C test case:
>   int x __attribute__((internal_linkage));
>   int x __attribute__((common));
>   int *f() { return &x; }

Thanks for noticing! Added missing attribute merging logic in SemaAttr.cpp.

Comment at: include/clang/Basic/Attr.td:2112
@@ +2111,3 @@
+def InternalLinkage : InheritableAttr {
+  let Spellings = [GCC<"internal_linkage">];
Because the list of subjects is long and unusual, and Subjects field does not support arbitrary lists - all combinations must have a specific diagnostic line elsewhere in the code.

This is checked in handleInternalLinkageAttr instead.



More information about the cfe-commits mailing list