This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64524] gcc can't detect same expression in both parts of ternary operator
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Jan 2015 20:37:56 +0000
- Subject: [Bug c++/64524] gcc can't detect same expression in both parts of ternary operator
- Auto-submitted: auto-generated
- References: <bug-64524-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64524
--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Andrew Pinski from comment #5)
> And really here is another false positive:
> #define a 1
> #define b 1
>
> int t = c > d ? a : b;
Assuming you meant
int t = (c > d) ? a : b;
then I'd be interested to find out how that's a false positive.
Just to add some salt into the pot, another interesting case might be
enum E { a, b, c, d };
void f(int val)
{
int n = (val >= 10) ? a : (d - 4);