diff options
author | Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> | 2003-05-25 12:59:22 +0000 |
---|---|---|
committer | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2003-05-25 12:59:22 +0000 |
commit | b7fc8b576e9aafd37dcc8e78a87372eb8eae011b (patch) | |
tree | b4fe5fbb56771ed361b7bb1fd800cb8a22806330 /gcc/cp/parser.c | |
parent | c7684ffe55c75b893fe40988dbb8fcea9beae3ba (diff) | |
download | gcc-b7fc8b576e9aafd37dcc8e78a87372eb8eae011b.zip gcc-b7fc8b576e9aafd37dcc8e78a87372eb8eae011b.tar.gz gcc-b7fc8b576e9aafd37dcc8e78a87372eb8eae011b.tar.bz2 |
parser.c (cp_parser_explicit_instantiation): Restore old access before template instantiation.
* parser.c (cp_parser_explicit_instantiation): Restore old
access before template instantiation.
* g++.dg/template/access11.C: New test.
From-SVN: r67166
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); } |