aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/path.d
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2022-04-20 16:02:52 -0400
committerMarek Polacek <polacek@redhat.com>2022-04-21 10:18:10 -0400
commit93b65ed9706e2ceb4be7b28c9ff9be759e68a614 (patch)
tree1c9ee3ccf843c0333d7c46427067da094ba9c041 /libphobos/src/std/path.d
parentc049f638da4f7b32b11e4d895184e0960bae5291 (diff)
downloadgcc-93b65ed9706e2ceb4be7b28c9ff9be759e68a614.zip
gcc-93b65ed9706e2ceb4be7b28c9ff9be759e68a614.tar.gz
gcc-93b65ed9706e2ceb4be7b28c9ff9be759e68a614.tar.bz2
c++: wrong error with constexpr COMPOUND_EXPR [PR105321]
Here we issue a bogus error for the first assert in the test. Therein we have <retval> = (void) (VIEW_CONVERT_EXPR<bool>(yes) || handle_error ());, VIEW_CONVERT_EXPR<int>(value); which has a COMPOUND_EXPR, so we get to cxx_eval_constant_expression <case COMPOUND_EXPR>. The problem here is that we call 7044 /* Check that the LHS is constant and then discard it. */ 7045 cxx_eval_constant_expression (ctx, op0, 7046 true, non_constant_p, overflow_p, 7047 jump_target); where lval is always true, so the PARM_DECL 'yes' is not evaluated into its value. Fixed by always passing false for 'lval' in cxx_eval_logical_expression; there's no case where we actually expect an lvalue from a TRUTH_*. PR c++/105321 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_logical_expression): Always pass false for lval to cxx_eval_constant_expression. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-105321.C: New test.
Diffstat (limited to 'libphobos/src/std/path.d')
0 files changed, 0 insertions, 0 deletions