diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 98f4f71..33fcb14 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2003-05-25 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> + + * parser.c (cp_parser_explicit_instantiation): Restore old + access before template instantiation. + 2003-05-23 Geoffrey Keating <geoffk@apple.com> * lang-specs.h: Use -o to specify preprocessor's output file. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index cf768e0..19172f0 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -8318,6 +8318,9 @@ cp_parser_explicit_instantiation (cp_parser* parser) tree type; type = check_tag_decl (decl_specifiers); + /* Turn access control back on for names used during + template instantiation. */ + pop_deferring_access_checks (); if (type) do_type_instantiation (type, extension_specifier, /*complain=*/1); } @@ -8332,13 +8335,14 @@ cp_parser_explicit_instantiation (cp_parser* parser) /*ctor_dtor_or_conv_p=*/NULL); decl = grokdeclarator (declarator, decl_specifiers, NORMAL, 0, NULL); + /* Turn access control back on for names used during + template instantiation. */ + pop_deferring_access_checks (); /* Do the explicit instantiation. */ do_decl_instantiation (decl, extension_specifier); } /* We're done with the instantiation. */ end_explicit_instantiation (); - /* Turn access control back on. */ - pop_deferring_access_checks (); cp_parser_consume_semicolon_at_end_of_statement (parser); } |