PR c++/66999 - 'this' captured by reference.
authorMarek Polacek <polacek@redhat.com>
Wed, 12 Jun 2019 22:41:35 +0000 (22:41 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 12 Jun 2019 22:41:35 +0000 (22:41 +0000)
commit22f6d174419e0649315049f5e2aec4b9a90e6ddc
tree9f88d2baf98fe2d850f45921a783813d7575ec0e
parent0d0137a37fc29c1dc94bb8f8f90b5fdece6cb64b
PR c++/66999 - 'this' captured by reference.

* parser.c (cp_parser_lambda_introducer): Reject `&this'.  Use
cp_lexer_nth_token_is instead of cp_lexer_peek_nth_token.

* g++.dg/cpp0x/lambda/lambda-this21.C: New test.

From-SVN: r272223
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this21.C [new file with mode: 0644]