]> granicus.if.org Git - clang/commitdiff
Fix test regression introduced by r145656. When seeing a string literal that isn...
authorTed Kremenek <kremenek@apple.com>
Fri, 2 Dec 2011 01:30:14 +0000 (01:30 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 2 Dec 2011 01:30:14 +0000 (01:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145662 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp

index fb884349291305f9ebaa71beadf2dcd5c0d6c786..da0e865862cc4de9b6e886f078f245d5ef5835b8 100644 (file)
@@ -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<IdentifierInfo *, 4> Names;
   ExprVector Constraints(Actions);