aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-05-08 22:52:41 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-05-08 22:52:41 +0000
commita8ef3ac9fa7637fad33d52614794b92e2261d65b (patch)
treedbfe429bafd43c2ba7f3d95a0ef1eefec8f98063 /lib/Sema/SemaOverload.cpp
parenta2447e0d1e28669cd637204a871f15b1215277fd (diff)
Allow implicit conversion from function pointer to void* in Microsoft mode.
Necessary to parse MFC code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 602ecd6602..e8dd56f66f 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1628,6 +1628,15 @@ bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
return true;
}
+ // MSVC allows implicit function to void* type conversion.
+ if (getLangOptions().Microsoft && FromPointeeType->isFunctionType() &&
+ ToPointeeType->isVoidType()) {
+ ConvertedType = BuildSimilarlyQualifiedPointerType(FromTypePtr,
+ ToPointeeType,
+ ToType, Context);
+ return true;
+ }
+
// When we're overloading in C, we allow a special kind of pointer
// conversion for compatible-but-not-identical pointee types.
if (!getLangOptions().CPlusPlus &&