blob: d35f9edf2ae0f9c3f9811ea713a7bd1704dfa8eb [file] [log] [blame]
// { dg-do run { target c++11 } }
#define assert(E) if(!(E))__builtin_abort();
int n = 0;
template <class T>
class Foo {
public:
Foo() {
n--;
}
Foo(const Foo&) {
n--;
}
~Foo() {
n++;
}
};
struct Data {};
void a()
{
Data b;
}
int main(int argc, char *argv[]) {
auto fn = [] (const Foo<Data>& x) {
return (x);
};
{
Foo<Data> a;
fn(a);
}
assert(n == 0);
}