diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-07-21 12:59:44 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-07-21 12:59:44 -0400 |
commit | a074ae297d5dbd69e03c6c30f9cb7720685fdb62 (patch) | |
tree | e5cf01de32d83dc231ffaa18894160426723ab34 /libbacktrace | |
parent | 5d6286903f325a7a85e5ab1d04ba942d33d755bc (diff) |
c++: non-dependent call to consteval operator [PR105912]
Here we're crashing when substituting a non-dependent call to a
consteval operator, whose CALL_EXPR_OPERATOR_SYNTAX flag we try to
propagate to the result, but the result isn't a CALL_EXPR since the
selected function is consteval. This patch fixes this by checking the
result of extract_call_expr accordingly. (Note that we can't check
DECL_IMMEDIATE_FUNCTION_P here because we don't know which function was
selected by overload resolution from here.)
PR c++/105912
gcc/cp/ChangeLog:
* call.cc (extract_call_expr): Return a NULL_TREE on failure
instead of asserting.
* pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Guard against
NULL_TREE extract_call_expr result.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/consteval31.C: New test.
(cherry picked from commit f70c18524221dcefa6cd26cee7b55503181bd912)
Diffstat (limited to 'libbacktrace')
0 files changed, 0 insertions, 0 deletions