https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84158
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #3) > As C++ now has standardized attributes, the question is what does the > standard say about whether standard attributes on a template are inherited > to specializations or not, and if the standard is fuzzy about it, what do > other compilers do. To my reading the standard doesn't specify attributes with enough detail to answer the question, but inheriting attributes wouldn't make sense. For another example, consider class templates and alignas: template <class T> struct alignas (32) A { T a; }; template <> struct A<int> { char c; }; static_assert (alignof (A<int>) < 32, "alignof A<int> < 32"); This passes with all compilers I tried, including Clang, GCC, ICC, and MSVC. It would be most surprising if the rules for class templates were different than for function templates.