https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124184
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:48b8d2dd48aaec275e2bdd84042a0adde9c953d8 commit r16-7629-g48b8d2dd48aaec275e2bdd84042a0adde9c953d8 Author: Jakub Jelinek <[email protected]> Date: Sun Feb 22 22:07:45 2026 +0100 c++: Fix up CWG 3123 expansion stmt handling once again [PR124184] Barry Revzin mentioned in private mail that we reject the following testcase even when it should be accepted. The problem is that I thought finish_call_expr with tf_none would be just harmless, but it is not, it can result in errors while trying to instantiate something else (e.g. the noexcept). So, instead of doing finish_call_expr with tf_none and only if that returns error_mark_node calling it again with tf_any_viable, the following patch just calls it only with tf_any_viable immediately. 2026-02-22 Jakub Jelinek <[email protected]> PR c++/124184 * parser.cc (cp_perform_range_for_lookup): If tf_error is missing, call finish_call_expr after perform_koenig_lookup calls immediately with tf_any_viable instead of twice, once with tf_none and then with tf_any_viable. * pt.cc (finish_expansion_stmt): Remove unneeded parens. * g++.dg/cpp26/expansion-stmt31.C: New test.
