This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84158] [6/7/8 Regression] missing -Wreturn-type due to incorrect handling of attributes for template specializations
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Feb 2018 02:38:09 +0000
- Subject: [Bug c++/84158] [6/7/8 Regression] missing -Wreturn-type due to incorrect handling of attributes for template specializations
- Auto-submitted: auto-generated
- References: <bug-84158-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84158
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Known to work| |4.7.4
Depends on| |83871
Summary|missing -Wreturn-type due |[6/7/8 Regression] missing
|to incorrect handling of |-Wreturn-type due to
|attributes for template |incorrect handling of
|specializations |attributes for template
| |specializations
Known to fail| |4.8.4, 4.9.4, 5.5.0, 6.4.0,
| |7.2.0, 8.0
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Bisection points to r190664 (GCC 4.8.0) as the first revision to fail to
diagnose the test case:
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.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83871
[Bug 83871] wrong code for attribute const and pure on distinct template
specializations