This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80129] wrong code with ternary struct assignment to const
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Mar 2017 11:13:25 +0000
- Subject: [Bug c++/80129] wrong code with ternary struct assignment to const
- Auto-submitted: auto-generated
- References: <bug-80129-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80129
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-03-21
CC| |trippels at gcc dot gnu.org
Ever confirmed|0 |1
Known to fail| |5.4.0, 6.3.0, 7.0
--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
struct pair {
bool first;
int second;
};
int main() {
bool b = false;
const pair x = b ? pair{true, 1} : pair{false, 0};
if (x.first)
__builtin_abort();
}