summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-07-08 20:04:39 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-07-08 20:04:39 +0000
commitcbe402967e2747e28580f9db0e3fd7b6303c06c5 (patch)
tree8725dbdc72d011b4e4ad50806a903d81f43a953e /lib/Sema/SemaExpr.cpp
parent0fb1c12a695b8ebff152c319da69f4cc6e9542db (diff)
downloadclang-cbe402967e2747e28580f9db0e3fd7b6303c06c5.tar.gz
[Sema] Resolve placeholder types before type deduction to silence
spurious `-Warc-repeated-use-of-weak` warnings The spurious -Warc-repeated-use-of-weak warnings are issued when an initializer expression uses a weak ObjC pointer. My first attempt to silence the warnings (r350917) caused clang to reject code that is legal in C++17. The patch is based on the feedback I received from Richard when the patch was reverted. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190422/268945.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190422/268943.html Differential Revision: https://reviews.llvm.org/D62645 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 466d9fdb9b..f44235491d 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -6678,6 +6678,14 @@ Sema::MaybeConvertParenListExprToParenExpr(Scope *S, Expr *OrigExpr) {
ExprResult Sema::ActOnParenListExpr(SourceLocation L,
SourceLocation R,
MultiExprArg Val) {
+ for (size_t I = 0, E = Val.size(); I != E; ++I)
+ if (Val[I]->hasNonOverloadPlaceholderType()) {
+ ExprResult Result = CheckPlaceholderExpr(Val[I]);
+ if (!Result.isUsable())
+ return ExprError();
+ Val[I] = Result.get();
+ }
+
return ParenListExpr::Create(Context, L, Val, R);
}