This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81607] Conditional operator: "type mismatch in shift expression" error
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 Aug 2017 08:56:15 +0000
- Subject: [Bug c++/81607] Conditional operator: "type mismatch in shift expression" error
- Auto-submitted: auto-generated
- References: <bug-81607-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81607
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Tue Aug 8 08:55:43 2017
New Revision: 250948
URL: https://gcc.gnu.org/viewcvs?rev=250948&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/other/bitfield6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-gimplify.c
trunk/gcc/testsuite/ChangeLog