]> granicus.if.org Git - clang/commitdiff
Clean up temporaries created by an asm statement. Fixes rdar://8540491
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 1 Nov 2010 21:51:42 +0000 (21:51 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 1 Nov 2010 21:51:42 +0000 (21:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117961 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp
test/SemaCXX/asm.cpp [new file with mode: 0644]

index d340d574d4d29f4f3f6ebb187c9acc20c3bc9cff..76956732d49b3d5b306439f9ffb5c4cdb357bd33 100644 (file)
@@ -1458,6 +1458,7 @@ bool Parser::ParseAsmOperandsOpt(llvm::SmallVectorImpl<IdentifierInfo *> &Names,
       SkipUntil(tok::r_paren);
       return true;
     }
+    Res = Actions.MakeFullExpr(Res.get()).release();
     Exprs.push_back(Res.release());
     // Eat the comma and continue parsing if it exists.
     if (Tok.isNot(tok::comma)) return false;
diff --git a/test/SemaCXX/asm.cpp b/test/SemaCXX/asm.cpp
new file mode 100644 (file)
index 0000000..cc2e6e7
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct A
+{
+    ~A();
+};
+int foo(A);
+
+void bar()
+{
+    A a;
+    asm("" : : "r"(foo(a)) ); // rdar://8540491
+}