summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-24 17:21:43 +0000
committerChris Lattner <sabre@nondot.org>2009-03-24 17:21:43 +0000
commitf37e09e0fc772c25a157cbf06e0e2115b0fc4f97 (patch)
tree8b54078d14d04803aa3b21e13c5f5b870f030693 /clang/lib
parentdeab7250fb367def89869a6acd6040f2b01d24b8 (diff)
downloadbcm5719-llvm-f37e09e0fc772c25a157cbf06e0e2115b0fc4f97.tar.gz
bcm5719-llvm-f37e09e0fc772c25a157cbf06e0e2115b0fc4f97.zip
improve error recovery for when type parsing fails.
llvm-svn: 67626
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index b140046fe43..c0b28775cee 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -1002,7 +1002,11 @@ Parser::OwningExprResult Parser::ParseBuiltinPrimaryExpression() {
case tok::kw___builtin_offsetof: {
SourceLocation TypeLoc = Tok.getLocation();
TypeResult Ty = ParseTypeName();
-
+ if (Ty.isInvalid()) {
+ SkipUntil(tok::r_paren);
+ return ExprError();
+ }
+
if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "",tok::r_paren))
return ExprError();
OpenPOWER on IntegriCloud