diff options
author | Richard Trieu <rtrieu@google.com> | 2018-10-20 02:15:58 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-10-20 02:15:58 +0000 |
commit | 6b13e89ab8035900f1103610812b02b0aff5c40e (patch) | |
tree | f396d2f0a4a495b46a3529dc8a43d1a47cfcfd3e /clang/lib/Sema/SemaStmt.cpp | |
parent | 2f7dc72525cb7680ff50bf24fdb63671fa060609 (diff) | |
download | bcm5719-llvm-6b13e89ab8035900f1103610812b02b0aff5c40e.tar.gz bcm5719-llvm-6b13e89ab8035900f1103610812b02b0aff5c40e.zip |
Make -Wfor-loop-analysis work with C++17
For now, disable the "variable in loop condition not modified" warning to not
be emitted when there is a structured binding variable in the loop condition.
https://bugs.llvm.org/show_bug.cgi?id=39285
llvm-svn: 344828
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index f0d19475827..16ed9ed767c 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -1409,7 +1409,11 @@ namespace { void VisitDeclRefExpr(DeclRefExpr *E) { VarDecl *VD = dyn_cast<VarDecl>(E->getDecl()); - if (!VD) return; + if (!VD) { + // Don't allow unhandled Decl types. + Simple = false; + return; + } Ranges.push_back(E->getSourceRange()); |