diff options
author | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2003-12-05 14:44:59 +0000 |
---|---|---|
committer | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2003-12-05 14:44:59 +0000 |
commit | f128e1f3326ab1f24d59110b70e118c95eb76fd5 (patch) | |
tree | 3d3ab9474c00e9a42836a8ad0de5b8ecae7011d4 /gcc/cp/parser.c | |
parent | 2a67ff5e9e1a909a2c4a056920abdfadbbe293dd (diff) | |
download | gcc-f128e1f3326ab1f24d59110b70e118c95eb76fd5.zip gcc-f128e1f3326ab1f24d59110b70e118c95eb76fd5.tar.gz gcc-f128e1f3326ab1f24d59110b70e118c95eb76fd5.tar.bz2 |
re PR c++/13166 ([DR136] not implemented)
PR c++/13166
* parser.c (cp_parser_late_parsing_default_args): Make sure the
context is a class before calling push_nested_class and
pop_nested_class.
* g++.dg/parse/defarg6.C: New test.
From-SVN: r74333
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 1ce8cd78..5f1b473 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -14239,10 +14239,10 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) saved_local_variables_forbidden_p = parser->local_variables_forbidden_p; parser->local_variables_forbidden_p = true; /* Parse the assignment-expression. */ - if (DECL_CONTEXT (fn)) + if (DECL_CLASS_SCOPE_P (fn)) push_nested_class (DECL_CONTEXT (fn)); TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser); - if (DECL_CONTEXT (fn)) + if (DECL_CLASS_SCOPE_P (fn)) pop_nested_class (); /* Restore saved state. */ |