Commit bac1187d by Paolo Carlini Committed by Paolo Carlini

re PR c++/79180 (Nested lambda-capture causes segfault for parameter pack)

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

	PR c++/79180
	* g++.dg/cpp0x/lambda/lambda-nested8.C: New.
	* g++.dg/torture/pr79180.C: Likewise.

	PR c++/71386
	* g++.dg/cpp1y/lambda-generic-nested1.C: New.

From-SVN: r253350
parent 22381c22
2017-10-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/79180
* g++.dg/cpp0x/lambda/lambda-nested8.C: New.
* g++.dg/torture/pr79180.C: Likewise.
PR c++/71386
* g++.dg/cpp1y/lambda-generic-nested1.C: New.
2017-10-02 Richard Biener <rguenther@suse.de>
* gcc.dg/graphite/graphite.exp: Add -fdump-tree-graphite-details.
......
// PR c++/79180
// { dg-do run { target c++11 } }
void
foo (int a)
{
if (a != 127)
__builtin_abort ();
}
template <typename... Args>
void
bar (Args &&... args)
{
[&]() { [&]() { foo (args...); } (); } ();
}
int
main ()
{
int x = 127;
bar (x);
}
// PR c++/71386
// { dg-do run { target c++14 } }
template<class...XS>
auto List(XS...xs)
{
return [=](auto processList){return processList(xs...);};
}
auto l1 = List(42);
int test (int a)
{
if (a != 42)
__builtin_abort ();
return 0;
}
auto foo = [](auto... xs1)
{
return [=]()
{
return l1([=](auto)
{
return test (xs1...);
});
};
};
int main()
{
auto concat = l1(foo);
concat();
}
// { dg-do run }
// { dg-options "-Wall -std=c++11" }
void
foo (int a)
{
if (a != 127)
__builtin_abort ();
}
template <typename... Args>
void
bar (Args &&... args)
{
[&]() { [&]() { foo (args...); } (); } ();
}
int
main ()
{
int x = 127;
bar (x);
}
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