PR c++/71546 - lambda init-capture with qualified-id.
* parser.c (cp_parser_lambda_introducer): Clear scope after each lambda capture. From-SVN: r258043
This commit is contained in:
parent
10b5c9829b
commit
76bd270a7d
3 changed files with 22 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2018-02-27 Håkon Sandsmark <hsandsmark@gmail.com>
|
||||
|
||||
PR c++/71546 - lambda init-capture with qualified-id.
|
||||
* parser.c (cp_parser_lambda_introducer): Clear scope after
|
||||
each lambda capture.
|
||||
|
||||
2018-02-27 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/84426
|
||||
|
|
|
@ -10440,6 +10440,12 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
|
|||
capture_init_expr,
|
||||
/*by_reference_p=*/capture_kind == BY_REFERENCE,
|
||||
explicit_init_p);
|
||||
|
||||
/* If there is any qualification still in effect, clear it
|
||||
now; we will be starting fresh with the next capture. */
|
||||
parser->scope = NULL_TREE;
|
||||
parser->qualifying_scope = NULL_TREE;
|
||||
parser->object_scope = NULL_TREE;
|
||||
}
|
||||
|
||||
cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
|
||||
|
|
10
gcc/testsuite/g++.dg/cpp1y/lambda-init17.C
Normal file
10
gcc/testsuite/g++.dg/cpp1y/lambda-init17.C
Normal file
|
@ -0,0 +1,10 @@
|
|||
// PR c++/71546
|
||||
// { dg-do compile { target c++14 } }
|
||||
|
||||
namespace n { struct make_shared { }; }
|
||||
|
||||
int main()
|
||||
{
|
||||
int x1;
|
||||
[e = n::make_shared (), x1]() {};
|
||||
}
|
Loading…
Add table
Reference in a new issue