From 375584c7ebcf78d4364e71363a35be230b93ea4d Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 1 Nov 2010 21:51:42 +0000 Subject: [PATCH] Clean up temporaries created by an asm statement. Fixes rdar://8540491 llvm-svn: 117961 --- clang/lib/Parse/ParseStmt.cpp | 1 + clang/test/SemaCXX/asm.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 clang/test/SemaCXX/asm.cpp diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index d340d574d4d2..76956732d49b 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1458,6 +1458,7 @@ bool Parser::ParseAsmOperandsOpt(llvm::SmallVectorImpl &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/clang/test/SemaCXX/asm.cpp b/clang/test/SemaCXX/asm.cpp new file mode 100644 index 000000000000..cc2e6e75ca14 --- /dev/null +++ b/clang/test/SemaCXX/asm.cpp @@ -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 +}