aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.def2
-rw-r--r--include/clang/Parse/Action.h3
-rw-r--r--include/clang/Parse/Scope.h13
3 files changed, 15 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.def b/include/clang/Basic/DiagnosticSemaKinds.def
index 34fc2e8ef7..b354bf8767 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.def
+++ b/include/clang/Basic/DiagnosticSemaKinds.def
@@ -869,6 +869,8 @@ DIAG(error_bad_receiver_type, ERROR,
"bad receiver type %0")
DIAG(warn_objc_throw_expects_object, WARNING,
"invalid %0 argument (expected an ObjC object type)")
+DIAG(error_rethrow_used_outside_catch, ERROR,
+ "‘@throw’ (rethrow) used outside of a @catch block")
// C++ casts
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 3c2ecfb0eb..4b2bdd2714 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -514,7 +514,8 @@ public:
}
virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
- ExprArg Throw) {
+ ExprArg Throw,
+ Scope *CurScope) {
return StmtEmpty();
}
diff --git a/include/clang/Parse/Scope.h b/include/clang/Parse/Scope.h
index edbc52730d..2efb809bbc 100644
--- a/include/clang/Parse/Scope.h
+++ b/include/clang/Parse/Scope.h
@@ -64,7 +64,11 @@ public:
/// FunctionPrototypeScope - This is a scope that corresponds to the
/// parameters within a function prototype.
- FunctionPrototypeScope = 0x100
+ FunctionPrototypeScope = 0x100,
+
+ /// AtCatchScope - This is a scope that corresponds to the Objective-C
+ /// @catch statement.
+ AtCatchScope = 0x200
};
private:
/// The parent scope for this scope. This is null for the translation-unit
@@ -77,7 +81,7 @@ private:
/// Flags - This contains a set of ScopeFlags, which indicates how the scope
/// interrelates with other control flow statements.
- unsigned Flags : 9;
+ unsigned Flags : 10;
/// WithinElse - Whether this scope is part of the "else" branch in
/// its parent ControlScope.
@@ -231,6 +235,11 @@ public:
return getFlags() & Scope::FunctionPrototypeScope;
}
+ /// isAtCatchScope - Return true if this scope is @catch.
+ bool isAtCatchScope() const {
+ return getFlags() & Scope::AtCatchScope;
+ }
+
/// isWithinElse - Whether we are within the "else" of the
/// ControlParent (if any).
bool isWithinElse() const { return WithinElse; }