On Sat, Jan 11, 2014 at 1:49 PM, [email protected] <[email protected]> wrote: > I'm not sure this is necessary - do any compilers (including different > versions of clang itself, which I believe is the main use of has_attribute) > support the same attribute but in differing syntaxes?
Yes, clang has numerous attributes instances of this. I believe GCC does as well. For instance, it's quite common to have a GNU spelling and a C++11 syntax for the same attribute. There are also cases where attributes with the same spelling but different syntax provide differing semantics, such as the aligned attribute (which has five different syntaxes). > Otherwise it just > seems an invariant of the attribute and not something that would need > compile time tests for because it won't vary by compilation I strongly disagree. Consider the dllexport example I had given. Supporting that is currently guess-work with __has_attribute because we only respond back that the attribute is known, but not a particular syntax. Yet the syntax is specifically required in order to use it properly. FWIW, this is also PR15853. ~Aaron _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
