* parser.c (cp_parser_lambda_declarator_opt): Make the pedwarn
conditional.
From-SVN: r215274
+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
/* 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");
int main()
{
- [](int a = 1) { return a; }(); // { dg-error "" }
+ [](int a = 1) { return a; }(); // { dg-error "default argument" "" { target { c++11_only } } }
}