summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-01-10 20:12:16 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-01-10 20:12:16 +0000
commit0a8485643114f0dcb0b1cd037d18872b43464888 (patch)
tree0bc4034cd8f4f49055bd972dbf99d26f680b0781 /clang/lib/Sema/SemaExpr.cpp
parent0f36e2354001754807c670ab9d562551a8a2175b (diff)
downloadbcm5719-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/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index eddf90178bc..f65e97ed0b7 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -14557,6 +14557,10 @@ void Sema::DiscardCleanupsInEvaluationContext() {
}
ExprResult Sema::HandleExprEvaluationContextForTypeof(Expr *E) {
+ ExprResult Result = CheckPlaceholderExpr(E);
+ if (Result.isInvalid())
+ return ExprError();
+ E = Result.get();
if (!E->getType()->isVariablyModifiedType())
return E;
return TransformToPotentiallyEvaluated(E);
OpenPOWER on IntegriCloud