[Bug c++/84542] New: missing -Wdeprecated-declarations on a redeclared function template
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Feb 24 15:31:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84542
Bug ID: 84542
Summary: missing -Wdeprecated-declarations on a redeclared
function template
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
Redeclaring an ordinary function with the deprecated attribute makes the
attribute effective on subsequent uses of the function.
However, redeclaring a function template with the same attribute has no effect
(regardless of whether the template has been defined).
$ cat a.C && gcc -S -Wall a.C
void f ();
void __attribute__ ((deprecated)) f ();
void ff ()
{
f (); // -Wdeprecated-declarations (good)
}
template <class T>
void g ();
template <class T>
void __attribute__ ((deprecated)) g ();
void gg ()
{
g<void>(); // missing warning
}
template <class T>
void __attribute__ ((deprecated)) g () { }
void ggg ()
{
g<void>(); // missing warning
}
a.C: In function ‘void ff()’:
a.C:7:6: warning: ‘void f()’ is deprecated [-Wdeprecated-declarations]
f (); // -Wdeprecated-declarations (good)
^
a.C:3:35: note: declared here
void __attribute__ ((deprecated)) f ();
^
More information about the Gcc-bugs
mailing list