2016-10-04 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77791
+ * parser.c (cp_parser_lambda_declarator_opt): Only pedwarn
+ for C++11 on decls in the param_list. Test cxx_dialect < cxx14 before
+ the loop just once.
+
* cp-tree.h (enum cp_tree_index): Remove CPTI_JAVA_*,
CPTI_LANG_NAME_JAVA and CPTI_JCLASS.
(java_byte_type_node, java_short_type_node, java_int_type_node,
/* 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) && cxx_dialect < cxx14)
- pedwarn (DECL_SOURCE_LOCATION (TREE_VALUE (t)), OPT_Wpedantic,
- "default argument specified for lambda parameter");
+ if (cxx_dialect < cxx14)
+ for (tree t = param_list; t; t = TREE_CHAIN (t))
+ if (TREE_PURPOSE (t) && DECL_P (TREE_VALUE (t)))
+ pedwarn (DECL_SOURCE_LOCATION (TREE_VALUE (t)), OPT_Wpedantic,
+ "default argument specified for lambda parameter");
cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN);
2016-10-04 Jakub Jelinek <jakub@redhat.com>
+ PR c++/77791
+ * g++.dg/cpp0x/lambda/lambda-77791.C: New test.
+
* g++.dg/other/java3.C: Remove.
* g++.dg/other/java1.C: Remove.
* g++.dg/other/error12.C: Remove.