https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125402
Bug ID: 125402
Summary: undiagnosed attribute applied to explicit
specialization
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: aoliva at gcc dot gnu.org
Target Milestone: ---
// { dg-do compile }
// { dg-options "-pedantic" }
template <typename T>
void f() {}
template [[deprecated]] // { dg-error "cannot appertain to an explicit
instantiation" }
void f<int>();
[dcl.attr.grammar]/5 in C++23 ends with a note that "An attribute-specifier-seq
cannot appeartain [sic] to an explicit instantiation".
(the typo is fixed in C++26 drafts)
I'm not sure we're required to diagnose this.
I suppose accepting this can be useful as an extension.
I expect there should be some strict conformance mode in which we report this
construct.