This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64524] gcc can't detect same expression in both parts of ternary operator


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64524

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should it complain only when the expressions are the same (e.g. token-wise), or
even when just two different expressions have the same value?
I mean, say:
enum X { E = 5, F = 5 };
int i = cond ? E : F;
int j = cond ? x + 3 : x + 2 + 1;
int k = cond ? sizeof (x) : sizeof (y);
etc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]