The actual result of name resolution in the class template is different from the c++ 03 standard

前端 未结 3 1622
太阳男子
太阳男子 2021-02-13 11:02

I test the code in the c++ standard ISO/IEC 14882-03 14.6.1/9 on Xcode 4.1 and Visual Studio 2008. The outputs of the two compiler are both different from the expected result of

3条回答
  •  余生分开走
    2021-02-13 11:45

    I don't know what to tell you except that I would agree with you that this is incorrect behavior.

    I think what's probably happening is that in the case of MSVC, the compiler is optimizing away an extra pass at the cost of ending up with the knowledge of a later-defined function that should not be use in the case of non-template calls. I must confess, I don't get how GCC/LLVM would end up with the results that they do, as the results are what you would expect as the exception and not the rule.

    I guess I'd file it as a bug on http://bugreport.apple.com/ and http://connect.microsoft.com/ and see what they say?

提交回复
热议问题