[Bug c++/60063] [5/6/7 Regression] -Wunused-local-typedefs warning despite attribute used in a template

2017-04-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60063

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
  Known to work||4.6.4
   Target Milestone|--- |5.5

[Bug c++/60063] [5/6/7 Regression] -Wunused-local-typedefs warning despite attribute used in a template

2017-02-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60063

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-02-16
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=79548
Summary|-Wunused-local-typedefs |[5/6/7 Regression]
   |warning despite attribute   |-Wunused-local-typedefs
   |used in a template  |warning despite attribute
   ||used in a template
 Ever confirmed|0   |1

--- Comment #3 from Martin Sebor  ---
No change in GCC 7.  The -Wunused-local-typedefs warning is still issued
inconsistently.  The warning on the template is a regression from GCC 4.6 most
likely introduced in r187757, along with bug 79548.

$ cat u.C && gcc -S -Wall -Wextra -Wpedantic -Wunused u.C
void foo ()
{
typedef __attribute__ ((used)) int T;
}

template 
void bar ()
{
  typedef __attribute__ ((used)) T U;
}
u.C: In function ‘void bar()’:
u.C:9:36: warning: typedef ‘U’ locally defined but not used
[-Wunused-local-typedefs]
   typedef __attribute__ ((used)) T U;
^