Commit 8bca3f59 by Paolo Carlini Committed by Paolo Carlini

re PR c++/78816 ([c++14] Static auto variable usage in generic/variadic lambda fails to compile)

2017-10-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78816
	* g++.dg/cpp1y/lambda-generic-variadic6.C: New.

From-SVN: r253397
parent 8a8e744e
2017-10-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/78816
* g++.dg/cpp1y/lambda-generic-variadic6.C: New.
2017-10-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/82374
......
// PR c++/78816
// { dg-do compile { target c++14 } }
void f(void (*f1)(int)) {
f1(42);
}
template <typename Lambda>
static auto callback(Lambda &&l)
{
static auto* p = &l;
p = &l;
return [](auto... x){ return (*p)(x...); };
}
int main() {
int x = 5;
f(callback([=](int y){}));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment