aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/expr.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-06-23 17:11:05 -0700
committerIan Lance Taylor <iant@golang.org>2022-06-24 11:24:57 -0700
commitbb403de36aa29e5398119e78a2c96794bdd6bad8 (patch)
tree3c1d19ed12841958ec7a834e3e2ff5a51c096843 /gcc/d/expr.cc
parentbb8e93eb1acae30a5fbe7e13149493ce4ccd301a (diff)
downloadgcc-bb403de36aa29e5398119e78a2c96794bdd6bad8.zip
gcc-bb403de36aa29e5398119e78a2c96794bdd6bad8.tar.gz
gcc-bb403de36aa29e5398119e78a2c96794bdd6bad8.tar.bz2
compiler: use bool for comma-ok if not already boolean
If a comma-ok variable already has a type, and that type is not a boolean type, then set the type of the temporary variable to bool. Otherwise we may try to convert an unnamed bool type to an interface type, which will fail. But we don't want to always use bool, because the type of the comma-ok variable may be a named bool type, in which case the assignment would fail (or need an explicit conversion). The test case is https://go.dev/cl/404496. Fixes golang/go#52535 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413894
Diffstat (limited to 'gcc/d/expr.cc')
0 files changed, 0 insertions, 0 deletions