aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-17 16:07:13 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-17 16:07:13 -0400
commit2516ccfe927c61a98bdd561eea90c7229a6a3cbc (patch)
tree84992412bfd78291d0e7bc2e3e2e23828796b124 /gcc/cp
parentb53abf71d275c3642dd65d4fdc98a0270fc5ee3c (diff)
downloadgcc-2516ccfe927c61a98bdd561eea90c7229a6a3cbc.zip
gcc-2516ccfe927c61a98bdd561eea90c7229a6a3cbc.tar.gz
gcc-2516ccfe927c61a98bdd561eea90c7229a6a3cbc.tar.bz2
semantics.c (finish_non_static_data_member): Preserve dereference in template.
* semantics.c (finish_non_static_data_member): Preserve dereference in template. From-SVN: r175152
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/semantics.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7d0a799..010f1dd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-17 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (finish_non_static_data_member): Preserve dereference
+ in template.
+
2011-06-16 Jason Merrill <jason@redhat.com>
PR c++/44160
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index bad7acb..a436623 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1557,7 +1557,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
tree type = TREE_TYPE (decl);
if (TREE_CODE (type) == REFERENCE_TYPE)
- type = TREE_TYPE (type);
+ /* Quals on the object don't matter. */;
else
{
/* Set the cv qualifiers. */
@@ -1572,7 +1572,8 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
type = cp_build_qualified_type (type, quals);
}
- return build_min (COMPONENT_REF, type, object, decl, NULL_TREE);
+ return (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