mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-02 21:11:33 +08:00
Do not diagnose lambda default arguments in c++14 modes.
* parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn conditional. From-SVN: r215274
This commit is contained in:
parent
717c478953
commit
6a3d8ef0b8
@ -1,3 +1,9 @@
|
||||
2014-09-15 Ville Voutilainen <ville.voutilainen@gmail.com>
|
||||
|
||||
Do not diagnose lambda default arguments in c++14 modes.
|
||||
* parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
|
||||
conditional.
|
||||
|
||||
2014-09-15 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* Make-lang.in (check_g++_parallelize): Change to just an upper bound
|
||||
|
@ -9222,7 +9222,7 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
|
||||
/* Default arguments shall not be specified in the
|
||||
parameter-declaration-clause of a lambda-declarator. */
|
||||
for (tree t = param_list; t; t = TREE_CHAIN (t))
|
||||
if (TREE_PURPOSE (t))
|
||||
if (TREE_PURPOSE (t) && cxx_dialect < cxx14)
|
||||
pedwarn (DECL_SOURCE_LOCATION (TREE_VALUE (t)), OPT_Wpedantic,
|
||||
"default argument specified for lambda parameter");
|
||||
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
[](int a = 1) { return a; }(); // { dg-error "" }
|
||||
[](int a = 1) { return a; }(); // { dg-error "default argument" "" { target { c++11_only } } }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user