]> granicus.if.org Git - clang/commitdiff
GCC fails if there is a trailing colon but no clobbers.
authorAnders Carlsson <andersca@mac.com>
Wed, 21 Nov 2007 23:27:34 +0000 (23:27 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 21 Nov 2007 23:27:34 +0000 (23:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44265 91177308-0d34-0410-b5e6-96231b3b80d8

Parse/ParseStmt.cpp
test/Parser/asm.c [new file with mode: 0644]

index 8d5be6868cf0328fe4f86d133853cf3aec8ee60c..6f871da118d28ace76fa74f1e33ef3e9329da435 100644 (file)
@@ -957,14 +957,12 @@ Parser::StmtResult Parser::ParseAsmStatement() {
   if (Tok.is(tok::colon)) {
     ConsumeToken();
     
-    if (isTokenStringLiteral()) {
-      // Parse the asm-string list for clobbers.
-      while (1) {
-        ParseAsmStringLiteral();
+    // Parse the asm-string list for clobbers.
+    while (1) {
+      ParseAsmStringLiteral();
 
-        if (Tok.isNot(tok::comma)) break;
-        ConsumeToken();
-      }
+      if (Tok.isNot(tok::comma)) break;
+      ConsumeToken();
     }
   }
   
diff --git a/test/Parser/asm.c b/test/Parser/asm.c
new file mode 100644 (file)
index 0000000..a09b545
--- /dev/null
@@ -0,0 +1,5 @@
+// RUN: clang -fsyntax-only -verify %s
+
+void f1() {
+  asm ("ret" : : :); // expected-error {{expected string literal}}
+}