[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2018-01-26 Thread aldyh at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

Aldy Hernandez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-01-26
 CC||aldyh at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Aldy Hernandez  ---
Confirmed.

[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2018-01-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2018-01-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.5

[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

--- Comment #2 from Martin Sebor  ---
Here's another test case with the same root cause (r190664):

$ cat u.C && gcc -S -Wall u.C
template 
int __attribute__ ((warn_unused_result)) f (T) { return 0; }

template <>
int f (int) { return 1; }

void fi () { f (0); }

u.C: In function ‘void fi()’:
u.C:7:16: warning: ignoring return value of ‘int f(T) [with T = int]’, declared
with attribute warn_unused_result [-Wunused-result]
 void fi () { f (0); }
  ~~^~~

[Bug c++/83502] [6/7/8 Regression] bogus -Wattributes for always_inline and noinline on function template specialization

2017-12-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83502

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=51213

--- Comment #1 from Martin Sebor  ---
Introduced in 4.8 by r190664:

PR c++/51213 (again)
* pt.c (deduction_tsubst_fntype): Remove.
(fn_type_unification): Check deduction depth and call
instantiate_template here.  Handle default argument access checks.
(determine_specialization): Suppress access control.
(tsubst_decl): Check for excessive deduction depth.
(recheck_decl_substitution): Make sure access control is on.
(type_unification_real): Don't mess with access deferring here.
(get_bindings): Adjust for fn_type_unification return type.
* call.c (enum rejection_reason_code): Drop rr_template_instantiation.
(template_instantiation_rejection): Remove.
(struct rejection_reason): Change targs to num_targs.
(template_unification_rejection, print_z_candidate): Adjust.
(add_template_candidate_real): Adjust for fn_type_unification change.
* class.c (resolve_address_of_overloaded_function): Likewise.
* cp-tree.h: Adjust declaration.