re PR c++/81607 (Conditional operator: "type mismatch in shift expression" error)
authorMarek Polacek <polacek@redhat.com>
Tue, 8 Aug 2017 08:55:43 +0000 (08:55 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 8 Aug 2017 08:55:43 +0000 (08:55 +0000)
commita5afbdd6559c8689424d5776e45cb77120730f43
tree86d8dfb9122f35b5054d9aab949bcea0da4b6552
parent314e6352040016aff26cc2cf0b9eb60c40ca859e
re PR c++/81607 (Conditional operator: "type mismatch in shift expression" error)

PR c++/81607
* cp-gimplify.c (cp_fold): If folding exposed a branch of
a COND_EXPR, convert it to the original type of the COND_EXPR, if
they differ.

* g++.dg/other/bitfield6.C: New test.

From-SVN: r250948
gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/bitfield6.C [new file with mode: 0644]