aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-08-02 18:52:16 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-08-02 18:52:16 +0000
commitfd9aef9d180a377a8804a40a89284956f36f0016 (patch)
tree81299072d7ee64d2599788c3e47f00daaea546e5 /gcc/cp/class.c
parent49634b3a45f7d9e65a521ac665014d6a81194dc4 (diff)
downloadgcc-fd9aef9d180a377a8804a40a89284956f36f0016.zip
gcc-fd9aef9d180a377a8804a40a89284956f36f0016.tar.gz
gcc-fd9aef9d180a377a8804a40a89284956f36f0016.tar.bz2
re PR c++/9447 (using Base<T>::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) <USING_DECL case>: 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
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c16
1 files changed, 15 insertions, 1 deletions
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;