diff options
author | Simon Martin <simon@nasilyan.com> | 2024-08-07 12:45:12 +0200 |
---|---|---|
committer | Simon Martin <simon@nasilyan.com> | 2024-08-07 12:48:16 +0200 |
commit | a1999cbc816ecd382c7af4ca44153379de49dcaf (patch) | |
tree | 6ee3b8a65ce634a937a5d7c101c909113ed1d142 /gcc/tree-iterator.cc | |
parent | 2083389a18d36684a88d9e2653bacc87ad894b50 (diff) | |
download | gcc-a1999cbc816ecd382c7af4ca44153379de49dcaf.zip gcc-a1999cbc816ecd382c7af4ca44153379de49dcaf.tar.gz gcc-a1999cbc816ecd382c7af4ca44153379de49dcaf.tar.bz2 |
c++: Fix ICE on valid involving variadic constructor [PR111592]
We currently ICE upon the following valid code, due to the fix made through
commit 9efe5fbde1e8
=== cut here ===
struct ignore { ignore(...) {} };
template<class... Args>
void InternalCompilerError(Args... args)
{ ignore{ ignore(args) ... }; }
int main() { InternalCompilerError(0, 0); }
=== cut here ===
Change 9efe5fbde1e8 avoids infinite recursion in build_over_call by returning
error_mark_node if one invokes ignore::ignore(...) with an argument of type
ignore, because otherwise we end up calling convert_arg_to_ellipsis for that
argument, and recurse into build_over_call with the exact same parameters.
This patch tightens the condition to only return error_mark_node if there's one
and only one parameter to the call being processed - otherwise we won't
infinitely recurse.
Successfully tested on x86_64-pc-linux-gnu.
PR c++/111592
gcc/cp/ChangeLog:
* call.cc (build_over_call): Only error out if there's a single
parameter of type A in a call to A::A(...).
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/variadic186.C: New test.
Diffstat (limited to 'gcc/tree-iterator.cc')
0 files changed, 0 insertions, 0 deletions