aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-07-29 11:16:50 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-07-29 11:16:50 +0000
commit399dedb996c18f40e5eb60d8707d86701b27db0e (patch)
treef933bf28ffc6e8514814d1f5e3aab7549afff83b /gcc/cp/semantics.c
parent16ff3a23ffdeb49c8b0b8672bbd26bdcd06681e4 (diff)
downloadgcc-399dedb996c18f40e5eb60d8707d86701b27db0e.zip
gcc-399dedb996c18f40e5eb60d8707d86701b27db0e.tar.gz
gcc-399dedb996c18f40e5eb60d8707d86701b27db0e.tar.bz2
re PR c++/9447 (using Base<T>::member does not work)
cp: PR c++/9447 * decl.c (add_binding): Add bval local variable. (push_class_level_binding): Likewise. Allow a USING_DECL to be pushed. * decl2.c (do_class_using_decl): The type of a using decl is unknown. * parser.c (cp_parser_postfix_expression): Refactor unqualified-id function call lookup code. * pt.c (tsubst): A USING_DECL will have unknown type. (tsubst_copy_and_build): Allow a using decl. (type_dependent_expression_p): A USING_DECL will make it dependent. * semantics.c (finish_member_declaration): Push a dependent using declaration. testsuite: PR c++/9447 * g++.dg/template/using1.C: New test. * g++.dg/template/using2.C: New test. * g++.dg/template/using3.C: New test. * g++.dg/template/using4.C: New test. From-SVN: r69921
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index bf30ca0..a94174a 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2030,7 +2030,9 @@ finish_member_declaration (tree decl)
/*friend_p=*/0);
}
/* Enter the DECL into the scope of the class. */
- else if (TREE_CODE (decl) == USING_DECL || pushdecl_class_level (decl))
+ else if ((TREE_CODE (decl) == USING_DECL && !processing_template_decl
+ && !dependent_type_p (DECL_INITIAL (decl)))
+ || pushdecl_class_level (decl))
{
/* All TYPE_DECLs go at the end of TYPE_FIELDS. Ordinary fields
go at the beginning. The reason is that lookup_field_1