------- Comment #2 from o dot kullmann at swansea dot ac dot uk 2006-02-25 20:15 ------- Sure, those additional brackets I missed because I created this case from scratch (and then forgot about it).
But the other points I don't see: I seems trivial for gcc to find this sort of error: Just watch out for const reference members in classes, and then see whether they are bound to a temporary (gcc warns about this in other cases, so it seems to know about temporaries) --- this seems easy to observe and seems never to be of any use. I don't understand "IPA". And finally, sure, books speak about lifetime of temporaries, but references are badly covered. And then this special behaviour of binding to temporaries, different for class members and block members, I carefully searched for it in the 30 something C++ books I have, but didn't find anything. (And if books not mentioning this are bad books, then most books seem to be bad, Stroustroup's, Meyers', Sutter's, etc. (maybe this is actually true)). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26471