https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116477
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <[email protected]>: https://gcc.gnu.org/g:4ee06690a47cd39b6003fc6589d4f292aeb67033 commit r16-4337-g4ee06690a47cd39b6003fc6589d4f292aeb67033 Author: Egas Ribeiro <[email protected]> Date: Tue Oct 7 22:48:56 2025 +0100 c++: Fix ICE with concept used as function [PR116477] As suggested by Patrick Palka in the bug report, the diagnostic check for concept_check_p(fn) was being done too late in finish_call_expr(), which led to an early return inside if (processing_template_decl), which meant that the error wouldn't be triggered when we are in a type dependence early exit. This fix makes sure that this error is handled in the semantic analysis phase, and avoids the failed assertion later in tsubst_expr(). PR c++/116477 gcc/cp/ChangeLog: * semantics.cc (finish_call_expr): Move concept_check_p diagnostic before processing_template_decl check to catch errors earlier. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr116477.C: New test. Signed-off-by: Egas Ribeiro <[email protected]>
