aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 1c00356..5f0872e 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1368,7 +1368,7 @@ build_offset_ref (tree type, tree name, bool address_p)
if (TREE_CODE (name) == TEMPLATE_DECL)
return name;
- if (processing_template_decl || uses_template_parms (type))
+ if (dependent_type_p (type) || type_dependent_expression_p (name))
return build_min_nt (SCOPE_REF, type, name);
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
@@ -1450,6 +1450,14 @@ build_offset_ref (tree type, tree name, bool address_p)
return error_mark_node;
}
+ if (processing_template_decl)
+ {
+ if (TREE_CODE (orig_name) == TEMPLATE_ID_EXPR)
+ return build_min (SCOPE_REF, TREE_TYPE (member), type, orig_name);
+ else
+ return build_min (SCOPE_REF, TREE_TYPE (member), type, name);
+ }
+
if (TREE_CODE (member) == TYPE_DECL)
{
TREE_USED (member) = 1;