diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 16b895c..8581375 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10114,10 +10114,11 @@ 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) && 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); |