summaryrefslogtreecommitdiffstats
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
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 a85b11274c8..bf1672127bf 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;
OpenPOWER on IntegriCloud