aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-06-29 15:44:12 -0400
committerJason Merrill <jason@gcc.gnu.org>2017-06-29 15:44:12 -0400
commit5497bd2bb6410e58eff6f57e53700dec646b1315 (patch)
tree10596600bfd5d55afc4ad9346fe54bd59ad8b26e /gcc
parentbecb93d02cc108fa8a13ff04062011d5d7981495 (diff)
downloadgcc-5497bd2bb6410e58eff6f57e53700dec646b1315.zip
gcc-5497bd2bb6410e58eff6f57e53700dec646b1315.tar.gz
gcc-5497bd2bb6410e58eff6f57e53700dec646b1315.tar.bz2
PR c++/81188 - matching decltype of member function call.
* tree.c (cp_tree_equal): Remove COMPONENT_REF special case. From-SVN: r249813
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype-call4.C13
3 files changed, 18 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 17da1c5..0fae3cd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/81188 - matching decltype of member function call.
+ * tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
+
2017-06-29 Nathan Sidwell <nathan@acm.org>
PR c++/81247
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4535af6..a52a9e8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3589,11 +3589,6 @@ cp_tree_equal (tree t1, tree t2)
return false;
return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t1, 1));
- case COMPONENT_REF:
- if (TREE_OPERAND (t1, 1) != TREE_OPERAND (t2, 1))
- return false;
- return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
-
case PARM_DECL:
/* For comparing uses of parameters in late-specified return types
with an out-of-class definition of the function, but can also come
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-call4.C b/gcc/testsuite/g++.dg/cpp0x/decltype-call4.C
new file mode 100644
index 0000000..d504954
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype-call4.C
@@ -0,0 +1,13 @@
+// PR c++/81188
+// { dg-do compile { target c++11 } }
+
+template <class F>
+struct C {
+ F fast(long i) const;
+ auto operator[](long i) const -> decltype(this->fast(i));
+};
+
+template <class F>
+auto C<F>::operator[](long i) const -> decltype(this->fast(i)) {
+ return fast(i);
+}