diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-05 17:10:05 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-05 17:10:05 +0000 |
commit | 51ad9cd9d2a35c639890261dd414ed0f8a700a5c (patch) | |
tree | 797313f98dd534d609fbdb9d29fdd54d54d9c0a6 /lib/Sema/SemaExpr.cpp | |
parent | 0d07455a786444c22ac41e9a15f58ff2c994b1d3 (diff) | |
download | clang-51ad9cd9d2a35c639890261dd414ed0f8a700a5c.tar.gz |
Revert rL359962 : Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.
........
Try to fix buildbots
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index a06e7dc51e..2d9dbdd342 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -16079,7 +16079,7 @@ void Sema::MarkDeclarationsReferencedInExpr(Expr *E, /// behavior of a program, such as passing a non-POD value through an ellipsis. /// Failure to do so will likely result in spurious diagnostics or failures /// during overload resolution or within sizeof/alignof/typeof/typeid. -bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef<const Stmt*> Stmts, +bool Sema::DiagRuntimeBehavior(SourceLocation Loc, const Stmt *Statement, const PartialDiagnostic &PD) { switch (ExprEvalContexts.back().Context) { case ExpressionEvaluationContext::Unevaluated: @@ -16095,9 +16095,9 @@ bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef<const Stmt*> Stmts, case ExpressionEvaluationContext::PotentiallyEvaluated: case ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed: - if (!Stmts.empty() && getCurFunctionOrMethodDecl()) { + if (Statement && getCurFunctionOrMethodDecl()) { FunctionScopes.back()->PossiblyUnreachableDiags. - push_back(sema::PossiblyUnreachableDiag(PD, Loc, Stmts)); + push_back(sema::PossiblyUnreachableDiag(PD, Loc, Statement)); return true; } @@ -16122,12 +16122,6 @@ bool Sema::DiagRuntimeBehavior(SourceLocation Loc, ArrayRef<const Stmt*> Stmts, return false; } -bool Sema::DiagRuntimeBehavior(SourceLocation Loc, const Stmt *Statement, - const PartialDiagnostic &PD) { - return DiagRuntimeBehavior( - Loc, Statement ? llvm::makeArrayRef(Statement) : llvm::None, PD); -} - bool Sema::CheckCallReturnType(QualType ReturnType, SourceLocation Loc, CallExpr *CE, FunctionDecl *FD) { if (ReturnType->isVoidType() || !ReturnType->isIncompleteType()) |