diff options
author | Jason Merrill <jason@redhat.com> | 2019-11-05 18:53:53 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-11-05 18:53:53 -0500 |
commit | b63566a4045e9cc27f739c89f863dbfb9dbe7860 (patch) | |
tree | 58847b80e23df24201c3f3e8327814203bd625f8 /gcc/cp/cp-objcp-common.c | |
parent | 6fda5f4981f1d249813c124576b037b12f6e8a61 (diff) | |
download | gcc-b63566a4045e9cc27f739c89f863dbfb9dbe7860.zip gcc-b63566a4045e9cc27f739c89f863dbfb9dbe7860.tar.gz gcc-b63566a4045e9cc27f739c89f863dbfb9dbe7860.tar.bz2 |
Fix conversions for built-in operator overloading candidates.
While working on C++20 operator<=>, I noticed that build_new_op_1 was doing
too much conversion when a built-in candidate was selected; the standard
says it should only perform user-defined conversions, and then leave the
normal operator semantics to handle any standard conversions. This is
important for operator<=> because a comparison of two different unscoped
enums is ill-formed; if we promote the enums to int here, cp_build_binary_op
never gets to see the original operand types, so we can't give the error.
I'm also disabling -Wmaybe-uninitialized for expmed.c to avoid the bootstrap
failure from the last time I applied this patch.
* call.c (build_new_op_1): Don't apply any standard conversions to
the operands of a built-in operator. Don't suppress conversions in
cp_build_unary_op.
* typeck.c (cp_build_unary_op): Do integral promotions for enums.
PR tree-optimization/91825
* expmed.c: Reduce -Wmaybe-uninitialized to warning.
From-SVN: r277864
Diffstat (limited to 'gcc/cp/cp-objcp-common.c')
0 files changed, 0 insertions, 0 deletions