]> granicus.if.org Git - clang/commit
Fix two bugs with temporaries:
authorAnders Carlsson <andersca@mac.com>
Fri, 13 Nov 2009 04:34:45 +0000 (04:34 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 13 Nov 2009 04:34:45 +0000 (04:34 +0000)
commit03d8ed439f55b692634f9c71721ecfabbe347c4d
treee91e74e5eaf2fe94a3497442f17d0821469ecd7d
parent764d0c23724b3671dcbe20af152fa1ad45f45e15
Fix two bugs with temporaries:

1. For

A f() {
return A();
}

we were incorrectly calling the A destructor on the returned object.

2. For

void f(A);
void g() {
A a;
f(a);
}

we were incorrectly not calling the copy constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87082 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCXX.cpp
lib/Sema/SemaExpr.cpp
test/CodeGenCXX/temporaries.cpp