From fc178519771db508c03611cff4a1466cf67fce1d Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 5 May 2021 22:25:45 -0400 Subject: c++: avoid non-TARGET_EXPR class prvalues Around PR98469 I asked Jakub to wrap a class BIT_CAST_EXPR in TARGET_EXPR; SPACESHIP_EXPR needs the same thing. The dummy CAST_EXPR created in can_convert is another instance of a non-TARGET_EXPR prvalue, so let's use the declval-like build_stub_object there instead. gcc/cp/ChangeLog: * cp-tree.h (build_stub_object): Declare. * method.c (build_stub_object): No longer static. * call.c (can_convert): Use it. * tree.c (build_dummy_object): Adjust comment. * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a TARGET_EXPR. --- gcc/cp/method.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/method.c') diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 0f416be..f8c9456 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1793,7 +1793,7 @@ build_stub_type (tree type, int quals, bool rvalue) /* Build a dummy glvalue from dereferencing a dummy reference of type REFTYPE. */ -static tree +tree build_stub_object (tree reftype) { if (!TYPE_REF_P (reftype)) -- cgit v1.1