https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64524
Mikhail Maltsev <maltsevm at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maltsevm at gmail dot com --- Comment #4 from Mikhail Maltsev <maltsevm at gmail dot com> --- > int k = cond ? sizeof (x) : sizeof (y); By the way, this is a good example of probable "false positives". Consider: constexpr std::size_t max_size = (sizeof(T1) > sizeof(T2)) ? sizeof(T1) : sizeof(T2); This is an example of "legal" code, it could be used for allocating a buffer which could hold either object of type T1 or type T2. These sizes may be platform-dependent (or they may depend on template parameters), so this code makes sence, but it will produce a warning when sizes are equal. So, probably this warning only makes sence, if ASTs' would be compared, not the values.