diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-07-02 21:03:14 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-07-02 21:03:14 +0000 |
commit | 642f173ae90097f0da877423172fe45a320e1e5f (patch) | |
tree | 284e9818d8cc8d4cf9782398cd4b3573104ff746 /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | 9c218592c8400f1ad2345b39e64904fda067553d (diff) | |
download | llvm-642f173ae90097f0da877423172fe45a320e1e5f.zip llvm-642f173ae90097f0da877423172fe45a320e1e5f.tar.gz llvm-642f173ae90097f0da877423172fe45a320e1e5f.tar.bz2 |
Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops.
The pattern was born out of the lack of range-based for loops in C++98
and is somewhat obscure. No functionality change intended.
llvm-svn: 241300
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index f3bcf76..2e3e63e 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -837,11 +837,13 @@ bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New, New->getLocation()); } -static CanThrowResult canSubExprsThrow(Sema &S, const Expr *CE) { - Expr *E = const_cast<Expr*>(CE); +static CanThrowResult canSubExprsThrow(Sema &S, const Expr *E) { CanThrowResult R = CT_Cannot; - for (Expr::child_range I = E->children(); I && R != CT_Can; ++I) - R = mergeCanThrow(R, S.canThrow(cast<Expr>(*I))); + for (const Stmt *SubStmt : E->children()) { + R = mergeCanThrow(R, S.canThrow(cast<Expr>(SubStmt))); + if (R == CT_Can) + break; + } return R; } |