diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2019-01-10 20:12:16 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2019-01-10 20:12:16 +0000 |
commit | 0a8485643114f0dcb0b1cd037d18872b43464888 (patch) | |
tree | 0bc4034cd8f4f49055bd972dbf99d26f680b0781 /clang/lib/Sema/SemaExprObjC.cpp | |
parent | 0f36e2354001754807c670ab9d562551a8a2175b (diff) | |
download | bcm5719-llvm-0a8485643114f0dcb0b1cd037d18872b43464888.tar.gz bcm5719-llvm-0a8485643114f0dcb0b1cd037d18872b43464888.zip |
[Sema] Call CheckPlaceholderExpr to resolve typeof or decltype
placeholder expressions while an unevaluated context is still on the
expression evaluation context stack.
This prevents recordUseOfWeek from being called when a weak variable is
used as an operand of a decltype or a typeof expression and fixes
spurious -Warc-repeated-use-of-weak warnings.
rdar://problem/45742525
Differential Revision: https://reviews.llvm.org/D55662
llvm-svn: 350887
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index ce80db7ca6e..ed780efd4cf 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -3161,7 +3161,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, Prop->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak; if (!IsWeak && Sel.isUnarySelector()) IsWeak = ReturnType.getObjCLifetime() & Qualifiers::OCL_Weak; - if (IsWeak && + if (IsWeak && !isUnevaluatedContext() && !Diags.isIgnored(diag::warn_arc_repeated_use_of_weak, LBracLoc)) getCurFunction()->recordUseOfWeak(Result, Prop); } |