]> granicus.if.org Git - clang/commit
In Microsoft mode(-fms-compatibility), prefer an integral conversion to a floating...
authorFrancois Pichet <pichet2000@gmail.com>
Sun, 18 Sep 2011 21:37:37 +0000 (21:37 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Sun, 18 Sep 2011 21:37:37 +0000 (21:37 +0000)
commit1c98d627e5f0b79365d4e64cd4c6795ebed895f3
tree001abfc5d66bcdc92643f368651a42a9eae19ae1
parent416f63e42d4c34a38833a3aa8fa1ebb3c847722b
In Microsoft mode(-fms-compatibility), prefer an integral conversion to a floating-to-integral conversion if the integral conversion is between types of the same size.

For example:
 void f(float);
 void f(int);
 int main {
    long a;
    f(a);
 }
Here, MSVC will call f(int) instead of generating a compile error as clang will do in standard mode.
This fixes a few errors when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140007 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaOverload.cpp
test/SemaCXX/MicrosoftCompatibility.cpp [new file with mode: 0644]