On 10/24/2011 02:13 PM, Gabriel Dos Reis wrote:
yes, but how does the compiler distinguish a "legacy code" compiled under C++11 from non-legacy C++11 code?
It doesn't.
The problem is with C++11 codes. There is no reason for them to be subjected to the inconsistency, especially for codes in header files that are upgraded (beyond control of the end user) and included in "legacy" codes. The "legacy" code may not have list-initialization in sfinae context, but the upgraded header file may have, without the end user knowing.
And that header is unaffected. Only initialization outside SFINAE context is affected.
It is wrong for a -Wflag to introduce that inconsistency in new codes.
What would you suggest instead? Jason