[PATCH] D13330: Implement __attribute__((unique_instantiation))

Keno Fischer via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 14:03:59 PDT 2015

loladiro added inline comments.

Comment at: include/clang/Basic/Attr.td:1463
@@ +1462,3 @@
+  let Spellings = [GNU<"unique_instantiation">];
+  let Subjects = SubjectList<[Function, CXXRecord], ErrorDiag>;
+  let Documentation = [UniqueInstantiationDocs];
majnemer wrote:
> They work ok, clang just thinks that it's a declaration of a variable template.  Try this:
>   template <typename T> T n = T();
>   extern template int n<int>;
>   template int n<int>;
I see. I'll look into adding support for it. Can you explain why my example doesn't work? GCC seems to allow this.



More information about the cfe-commits mailing list