diff options
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index fea2696..a08a2a5 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1861,7 +1861,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) if (current_class_ptr) TREE_USED (current_class_ptr) = 1; - if (processing_template_decl && !qualifying_scope) + if (processing_template_decl) { tree type = TREE_TYPE (decl); @@ -1882,17 +1882,16 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) type = cp_build_qualified_type (type, quals); } - ret = (convert_from_reference - (build_min (COMPONENT_REF, type, object, decl, NULL_TREE))); + if (qualifying_scope) + /* Wrap this in a SCOPE_REF for now. */ + ret = build_qualified_name (type, qualifying_scope, decl, + /*template_p=*/false); + else + ret = (convert_from_reference + (build_min (COMPONENT_REF, type, object, decl, NULL_TREE))); } /* If PROCESSING_TEMPLATE_DECL is nonzero here, then - QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF - for now. */ - else if (processing_template_decl) - ret = build_qualified_name (TREE_TYPE (decl), - qualifying_scope, - decl, - /*template_p=*/false); + QUALIFYING_SCOPE is also non-null. */ else { tree access_type = TREE_TYPE (object); |