From fd9aef9d180a377a8804a40a89284956f36f0016 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Sat, 2 Aug 2003 18:52:16 +0000 Subject: re PR c++/9447 (using Base::member does not work) cp: PR c++/9447 * cp-tree.def (USING_DECL): Document its type. * class.c (pushclass): If we're entering a template, push any dependent using decls it has. * decl2.c (do_class_using_decl): Refactor. Type is NULL iff it is a dependent scope. * pt.c (tsubst_decl) : Set type. (tsubst): Remove USING_DECL checks. (type_dependent_expression_p): Remove USING_DECL case. * semantics.c (finish_member_declaration): A USING_DECL's type indicates whether it is dependent. testsuite: PR c++/9447 * g++.dg/template/using7.C: New test. From-SVN: r70107 --- gcc/cp/class.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gcc/cp/class.c') diff --git a/gcc/cp/class.c b/gcc/cp/class.c index a85b112..bf16721 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5457,7 +5457,21 @@ pushclass (tree type) pushlevel_class (); if (type != previous_class_type || current_class_depth > 1) - push_class_decls (type); + { + push_class_decls (type); + if (CLASSTYPE_IS_TEMPLATE (type)) + { + /* If we are entering the scope of a template (not a + specialization), we need to push all the using decls with + dependent scope too. */ + tree fields; + + for (fields = TYPE_FIELDS (type); + fields; fields = TREE_CHAIN (fields)) + if (TREE_CODE (fields) == USING_DECL && !TREE_TYPE (fields)) + pushdecl_class_level (fields); + } + } else { tree item; -- cgit v1.1