diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-29 19:44:12 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-29 19:44:12 +0000 |
commit | cbe9130c1535b21dd9aae80b4a03f826d0bb1198 (patch) | |
tree | 10596600bfd5d55afc4ad9346fe54bd59ad8b26e | |
parent | fb823e6854d69ed99e9926a00bb7a87b023fa64e (diff) |
PR c++/81188 - matching decltype of member function call.
* tree.c (cp_tree_equal): Remove COMPONENT_REF special case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249813 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/tree.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype-call4.C | 13 |
3 files changed, 18 insertions, 5 deletions
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 <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 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 <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); +} |