http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54348
--- Comment #7 from Jason Vas Dias <jason.vas.dias at gmail dot com> 2012-08-21 20:34:06 UTC --- (In reply to comment #2) > (In reply to comment #0) > > Shouldn't g++ be complaining about initializing a string with a list<string> > > rather than this cryptic "no match for ternary 'operator?:'" here ? > > No, not really. > > The object being initialized by the result of the condition expression is > irrelevant, the conditional expression isn't valid whether or not you're using > it to initialize another object. > > In this reduced version it wouldn't make sense to refer to initializing any > object with any other: > > struct A {} a; > struct B {} b; > > void f() > { > false ? a : b; > } but this is not the same. surely ? the above is not a valid statement - I was saying: some_type some_object = false ? a : b;