diff options
author | Jason Merrill <jason@redhat.com> | 2013-05-24 16:02:07 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-05-24 16:02:07 -0400 |
commit | 9f57f76aae9ad3be8efb5c1200353261e2ef7f34 (patch) | |
tree | 335d7fb06c96580fbf4c114fb7f247cc59e0abf8 /gcc | |
parent | 9797bec93954fd4c7dfb48a4e26b7062fb589f90 (diff) | |
download | gcc-9f57f76aae9ad3be8efb5c1200353261e2ef7f34.zip gcc-9f57f76aae9ad3be8efb5c1200353261e2ef7f34.tar.gz gcc-9f57f76aae9ad3be8efb5c1200353261e2ef7f34.tar.bz2 |
re PR c++/56971 (GCC claims a friend function to be overloaded, but it isn't)
PR c++/56971
* pt.c (any_template_arguments_need_structural_equality_p): A
TEMPLATE_TEMPLATE_PARM can require structural type comparison.
From-SVN: r199315
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/ttp28.C | 21 |
3 files changed, 28 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7b02b8b..4d13955 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-05-24 Jason Merrill <jason@redhat.com> + + PR c++/56971 + * pt.c (any_template_arguments_need_structural_equality_p): A + TEMPLATE_TEMPLATE_PARM can require structural type comparison. + 2013-05-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/19618 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 903d529..d9a14cc 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -20367,8 +20367,7 @@ any_template_arguments_need_structural_equality_p (tree args) if (error_operand_p (arg)) return true; - else if (TREE_CODE (arg) == TEMPLATE_DECL - || TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM) + else if (TREE_CODE (arg) == TEMPLATE_DECL) continue; else if (TYPE_P (arg) && TYPE_STRUCTURAL_EQUALITY_P (arg)) return true; diff --git a/gcc/testsuite/g++.dg/template/ttp28.C b/gcc/testsuite/g++.dg/template/ttp28.C new file mode 100644 index 0000000..a15dea1 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/ttp28.C @@ -0,0 +1,21 @@ +// PR c++/56971 + +template <typename T> +class rp { +}; + +template <template <typename> class P> +struct b { + template <class, template <typename> class FriendP> + friend void f(b<FriendP> from); +}; + +template <class, template <typename> class P> +void f(b<P> from) { +} + +int main() { + b<rp> v; + f<int>(v); + return 0; +} |