diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2017-05-09 04:06:24 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2017-05-09 04:06:24 +0000 |
commit | 1dbfa856b1172d045baecaeab6711b0d01377970 (patch) | |
tree | d8a1ed1a754cc6a2fd02a45b4f70625882ec122e /clang/lib/Sema/SemaCast.cpp | |
parent | b35ef2a599aa71b4aac027429e0c19d16dc274b7 (diff) | |
download | bcm5719-llvm-1dbfa856b1172d045baecaeab6711b0d01377970.tar.gz bcm5719-llvm-1dbfa856b1172d045baecaeab6711b0d01377970.zip |
[Sema] Make typeof(OverloadedFunctionName) not a pointer.
We were sometimes doing a function->pointer conversion in
Sema::CheckPlaceholderExpr, which isn't the job of CheckPlaceholderExpr.
So, when we saw typeof(OverloadedFunctionName), where
OverloadedFunctionName referenced a name with only one function that
could have its address taken, we'd give back a function pointer type
instead of a function type. This is incorrect.
I kept the logic for doing the function pointer conversion in
resolveAndFixAddressOfOnlyViableOverloadCandidate because it was more
consistent with existing ResolveAndFix* methods.
llvm-svn: 302506
Diffstat (limited to 'clang/lib/Sema/SemaCast.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCast.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 7e91709e67d..7d534263f46 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -1871,7 +1871,8 @@ static bool fixOverloadedReinterpretCastExpr(Sema &Self, QualType DestType, // No guarantees that ResolveAndFixSingleFunctionTemplateSpecialization // preserves Result. Result = E; - if (!Self.resolveAndFixAddressOfOnlyViableOverloadCandidate(Result)) + if (!Self.resolveAndFixAddressOfOnlyViableOverloadCandidate( + Result, /*DoFunctionPointerConversion=*/true)) return false; return Result.isUsable(); } |