void foo( char* ); int main() { foo( 0 ? "a" : "b" ); // }
The type of expression (0 ? "a" : "b") is const char[2] but it cannot be transformed to char*, however it works. Why? -- Summary: condition expression and strings literal Product: gcc Version: 3.4.5 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: anton dot kirillov at rd-software dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25992