From: Ted Kremenek Date: Fri, 2 Dec 2011 01:30:14 +0000 (+0000) Subject: Fix test regression introduced by r145656. When seeing a string literal that isn... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=320fa4b6051ff032aaa50d924ca39e3d529dcf5f;p=clang Fix test regression introduced by r145656. When seeing a string literal that isn't accepted by 'asm', skip to the enclosing ')'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145662 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index fb88434929..da0e865862 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -1759,8 +1759,13 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) { T.consumeOpen(); ExprResult AsmString(ParseAsmStringLiteral()); - if (AsmString.isInvalid()) + if (AsmString.isInvalid()) { + // If the reason we are recovering is because of an improper string + // literal, it makes the most sense just to consume to the ')'. + if (isTokenStringLiteral()) + T.skipToEnd(); return StmtError(); + } SmallVector Names; ExprVector Constraints(Actions);