re PR c++/84518 (ICE with lambda capturing broken variable)

2019-03-07  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84518
	* g++.dg/cpp0x/lambda/lambda-ice30.C: New.
	* g++.dg/cpp0x/lambda/lambda-ice31.C: Likewise.

From-SVN: r269469
This commit is contained in:
Paolo Carlini 2019-03-07 20:49:42 +00:00 committed by Paolo Carlini
parent 90a0bf4e02
commit c7163b643e
3 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2019-03-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84518
* g++.dg/cpp0x/lambda/lambda-ice30.C: New.
* g++.dg/cpp0x/lambda/lambda-ice31.C: Likewise.
2019-03-07 Jakub Jelinek <jakub@redhat.com>
PR translation/79999

View File

@ -0,0 +1,13 @@
// PR c++/84518
// { dg-do compile { target c++11 } }
template<int> void foo()
{
int x[=]; // { dg-error "expected" }
[&x]{};
}
void bar()
{
foo<0>();
}

View File

@ -0,0 +1,8 @@
// PR c++/84518
// { dg-do compile { target c++11 } }
template<typename T> void foo()
{
T x[=]; // { dg-error "expected" }
[&x]{};
}