diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-06-10 19:12:52 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-06-10 19:12:52 +0000 |
| commit | 97bc6c731eabb6212f094302b94f3f0f9534ebdf (patch) | |
| tree | 471dda8f5419bb81beedeeef3b8975938d7e7340 /contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp | |
| parent | 3adc74c768226112b373d0bcacee73521b0aed2a (diff) | |
| parent | 85d8b2bbe386bcfe669575d05b61482d7be07e5d (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp index 091e77936c1e..d9dc4df9f271 100644 --- a/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp @@ -1081,6 +1081,15 @@ static TryCastResult TryStaticCast(Sema &Self, ExprResult &SrcExpr, Kind = CK_BitCast; return TC_Success; } + + // Microsoft permits static_cast from 'pointer-to-void' to + // 'pointer-to-function'. + if (!CStyle && Self.getLangOpts().MSVCCompat && + DestPointee->isFunctionType()) { + Self.Diag(OpRange.getBegin(), diag::ext_ms_cast_fn_obj) << OpRange; + Kind = CK_BitCast; + return TC_Success; + } } else if (DestType->isObjCObjectPointerType()) { // allow both c-style cast and static_cast of objective-c pointers as |
