diff options
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 84f3b8459af..55ce6841723 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8508,14 +8508,18 @@ nonstatic_local_decl_p (tree t) function. */ static tree -local_variable_p_walkfn (tree* tp, - int* walk_subtrees ATTRIBUTE_UNUSED , - void* data ATTRIBUTE_UNUSED ) +local_variable_p_walkfn (tree *tp, int *walk_subtrees, + void *data ATTRIBUTE_UNUSED) { - return ((local_variable_p (*tp) && !DECL_ARTIFICIAL (*tp)) - ? *tp : NULL_TREE); + if (local_variable_p (*tp) && !DECL_ARTIFICIAL (*tp)) + return *tp; + else if (TYPE_P (*tp)) + *walk_subtrees = 0; + + return NULL_TREE; } + /* Check that ARG, which is a default-argument expression for a parameter DECL, is valid. Returns ARG, or ERROR_MARK_NODE, if something goes wrong. DECL may also be a _TYPE node, rather than a |