summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-09-10 20:55:33 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-09-10 20:55:33 +0000
commit369e51fa400aeb5835bb9af4634ea516c11429a7 (patch)
treeec4e211d92e0c38fe1d41ec106beefe97c37690a /include
parent200121569dc6cff10a1fb6ed7500098770b9dd25 (diff)
downloadclang-369e51fa400aeb5835bb9af4634ea516c11429a7.tar.gz
clang-369e51fa400aeb5835bb9af4634ea516c11429a7.tar.bz2
clang-369e51fa400aeb5835bb9af4634ea516c11429a7.tar.xz
Implement Expr::CanThrow, a function that applies the noexcept operator rules to expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/Expr.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index debc637745..4cf2d17076 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -253,7 +253,7 @@ public:
bool isRValue() const { return Kind >= CL_XValue; }
bool isModifiable() const { return getModifiable() == CM_Modifiable; }
};
- /// \brief classify - Classify this expression according to the C++0x
+ /// \brief Classify - Classify this expression according to the C++0x
/// expression taxonomy.
///
/// C++0x defines ([basic.lval]) a new taxonomy of expressions to replace the
@@ -269,7 +269,7 @@ public:
return ClassifyImpl(Ctx, 0);
}
- /// \brief classifyModifiable - Classify this expression according to the
+ /// \brief ClassifyModifiable - Classify this expression according to the
/// C++0x expression taxonomy, and see if it is valid on the left side
/// of an assignment.
///
@@ -408,6 +408,16 @@ public:
/// write barrier.
bool isOBJCGCCandidate(ASTContext &Ctx) const;
+ /// \brief Result type of CanThrow().
+ enum CanThrowResult {
+ CT_Cannot,
+ CT_Dependent,
+ CT_Can
+ };
+ /// \brief Test if this expression, if evaluated, might throw, according to
+ /// the rules of C++ [expr.unary.noexcept].
+ CanThrowResult CanThrow(ASTContext &C) const;
+
/// IgnoreParens - Ignore parentheses. If this Expr is a ParenExpr, return
/// its subexpression. If that subexpression is also a ParenExpr,
/// then this method recursively returns its subexpression, and so forth.