While looking at having a better error message (giving types in the message "operands to ?: have different types", I found a strange behaviour of gcc.
When a variable is declared local (a function parameter) it gives the message "no match for 'operator-'" and when declared global it gives the above mentionned message. I'm attaching a testcase. This is for mainline but was already true for 3.4.3. -- Summary: Differing error messages depending on thelocality of a variable Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: minor Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: theodore dot papadopoulo at sophia dot inria dot fr CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22549