re PR c++/77914 (Wrong lambda definition accepted)
authorJakub Jelinek <jakub@redhat.com>
Wed, 25 Jan 2017 20:51:10 +0000 (21:51 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 25 Jan 2017 20:51:10 +0000 (21:51 +0100)
commit0e3438689a6ffc4851ba8162306e5a1709b3b905
treef2650b34e22820c5d245ad9ef44382fa36501c9e
parent0d098f4ba1e41740223fe0b5f79462c42703c30b
re PR c++/77914 (Wrong lambda definition accepted)

PR c++/77914
* parser.c (cp_parser_lambda_declarator_opt): Pedwarn with
OPT_Wpedantic on lambda templates for -std=c++14 and higher.

* g++.dg/cpp1y/lambda-generic-77914.C: New test.
* g++.dg/cpp1y/lambda-generic-dep.C: Add -pedantic to dg-options,
expect a warning.
* g++.dg/cpp1y/lambda-generic-x.C: Add -Wpedantic to dg-options,
expect warnings.
* g++.dg/cpp1y/lambda-generic-mixed.C: Add empty dg-options.
* g++.dg/cpp1y/pr59636.C: Likewise.
* g++.dg/cpp1y/pr60190.C: Likewise.

From-SVN: r244907
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-generic-77914.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/lambda-generic-dep.C
gcc/testsuite/g++.dg/cpp1y/lambda-generic-mixed.C
gcc/testsuite/g++.dg/cpp1y/lambda-generic-x.C
gcc/testsuite/g++.dg/cpp1y/pr59636.C
gcc/testsuite/g++.dg/cpp1y/pr60190.C