mirror of git://gcc.gnu.org/git/gcc.git
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>
|
2014-09-15 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* Make-lang.in (check_g++_parallelize): Change to just an upper bound
|
* 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
|
/* Default arguments shall not be specified in the
|
||||||
parameter-declaration-clause of a lambda-declarator. */
|
parameter-declaration-clause of a lambda-declarator. */
|
||||||
for (tree t = param_list; t; t = TREE_CHAIN (t))
|
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,
|
pedwarn (DECL_SOURCE_LOCATION (TREE_VALUE (t)), OPT_Wpedantic,
|
||||||
"default argument specified for lambda parameter");
|
"default argument specified for lambda parameter");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
[](int a = 1) { return a; }(); // { dg-error "" }
|
[](int a = 1) { return a; }(); // { dg-error "default argument" "" { target { c++11_only } } }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue