[Bug c++/54348] confusing error reported for type mismatch in conditional expression : "error: no match for ternary 'operator?:' in 'false ?"

jason.vas.dias at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 21 20:52:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54348

--- Comment #8 from Jason Vas Dias <jason.vas.dias at gmail dot com> 2012-08-21 20:52:12 UTC ---
All I'm suggesting is that g++ should try to find the most basic error, 
which is that different type objects are returned as the result of a
conditional expression, and not  "no match for ternary 'operator?:'" -
what does this mean, it was searching namespace std:: for string::operator::?:
?
then this succeeded, and it found it could not apply it because the types
were different - shouldn't it complain about the root cause, that the types
were different, rather than the symptom of not being able to satisfy
operator std::string::?:() ?



More information about the Gcc-bugs mailing list