[Bug c++/126280] [13/14/15/16/17 Regression] "used but never defined" warning for function template used in variadic template from a template
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 3 21:16:28 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126280
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:9213ce6f9329a59cc8adc7d675d7aca3aa49bf81
commit r15-11541-g9213ce6f9329a59cc8adc7d675d7aca3aa49bf81
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Jul 25 16:12:19 2026 -0400
c++: function NTTP argument in pack considered unused [PR126280]
This is just the pack version of PR c++/105848, in which our non-dependent
call pruning may cause us to not mark an otherwise unused function pointer
template argument within a pack as used.
PR c++/126280
gcc/cp/ChangeLog:
* pt.cc (mark_template_arguments_used): Split out loop into ...
(mark_template_arguments_used_1): ... here. Recurse into
argument packs.
gcc/testsuite/ChangeLog:
* g++.dg/template/fn-ptr6.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit d47f48643b3db4e207b0cc3382f614aa76c9c2c5)
More information about the Gcc-bugs
mailing list