From: Jason Merrill Date: Thu, 29 Jun 2017 19:44:12 +0000 (-0400) Subject: PR c++/81188 - matching decltype of member function call. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5497bd2bb6410e58eff6f57e53700dec646b1315;p=gcc.git PR c++/81188 - matching decltype of member function call. * tree.c (cp_tree_equal): Remove COMPONENT_REF special case. From-SVN: r249813 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 17da1c5868d..0fae3cd6684 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2017-06-29 Jason Merrill + + PR c++/81188 - matching decltype of member function call. + * tree.c (cp_tree_equal): Remove COMPONENT_REF special case. + 2017-06-29 Nathan Sidwell PR c++/81247 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 4535af64dc6..a52a9e8fa9f 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 00000000000..d504954bc63 --- /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 +struct C { + F fast(long i) const; + auto operator[](long i) const -> decltype(this->fast(i)); +}; + +template +auto C::operator[](long i) const -> decltype(this->fast(i)) { + return fast(i); +}