[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

2020-04-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79585

Jason Merrill  changed:

   What|Removed |Added

   Target Milestone|10.0|9.4
 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Jason Merrill  ---
Fixed for 9.4/10.

[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

2020-04-28 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79585

--- Comment #4 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:aa988998be8f85334665a6b049d5d9139408c250

commit r9-8550-gaa988998be8f85334665a6b049d5d9139408c250
Author: Jason Merrill 
Date:   Mon Jan 27 05:45:01 2020 -0500

c++: Avoid ICE with dependent attribute on type.

We previously happened to accept this testcase, but never actually did
anything useful with the attribute.  The patch for PR86379 stopped using
TREE_TYPE as USING_DECL_SCOPE, so 'using A::b' no longer had TREE_TYPE set,
so the language-independent decl_attributes started crashing on it.

GNU attributes are more flexible in their placement than C++11 attributes,
so if we encounter a dependent GNU attribute that syntactically appertains
to a type rather than the declaration as a whole, move it to the
declaration; that's almost certainly what the user meant, anyway.

gcc/cp/ChangeLog
2020-01-27  Jason Merrill  

PR c++/90750
PR c++/79585
* decl.c (grokdeclarator): Move dependent attribute to decl.
* decl2.c (splice_template_attributes): No longer static.

[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

2020-04-27 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79585

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:5f1cd1da1a805c3d00332da45c3ab78a3931af63

commit r10-7998-g5f1cd1da1a805c3d00332da45c3ab78a3931af63
Author: Jason Merrill 
Date:   Mon Jan 27 05:45:01 2020 -0500

c++: Avoid ICE with dependent attribute on type.

We previously happened to accept this testcase, but never actually did
anything useful with the attribute.  The patch for PR86379 stopped using
TREE_TYPE as USING_DECL_SCOPE, so 'using A::b' no longer had TREE_TYPE set,
so the language-independent decl_attributes started crashing on it.

GNU attributes are more flexible in their placement than C++11 attributes,
so if we encounter a dependent GNU attribute that syntactically appertains
to a type rather than the declaration as a whole, move it to the
declaration; that's almost certainly what the user meant, anyway.

gcc/cp/ChangeLog
2020-04-27  Jason Merrill  

PR c++/90750
PR c++/79585
* decl.c (grokdeclarator): Move dependent attribute to decl.
* decl2.c (splice_template_attributes): No longer static.

[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

2020-04-27 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79585

Jason Merrill  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
   Target Milestone|--- |10.0
 CC||jason at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

2017-08-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79585

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-08-22
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1
  Known to fail||4.0.1, 8.0

--- Comment #2 from Eric Gallager  ---
Confirmed.

[Bug c++/79585] spurious -Wunused-variable on a pointer with attribute unused in function template

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

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
  Known to fail||4.1.3, 4.2.2, 4.3.2, 4.6.0,
   ||5.3.0, 6.3.0, 7.0

--- Comment #1 from Martin Sebor  ---
The same spurious warning goes at least as far back as GCC 4.  Clang doesn't
have the problem.