c++: partial ordering with memfn ptr cst [PR108104]
authorPatrick Palka <ppalka@redhat.com>
Thu, 15 Dec 2022 20:38:47 +0000 (15:38 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 15 Dec 2022 20:38:47 +0000 (15:38 -0500)
commit38304846d18d6bb14b0fd6c627c5c6d43a814d01
tree8f6474af6dd0b50f264b3736c481a7cbbd7965d2
parent12abd5a7d13209f79664ea603b3f3517f71b8c4f
c++: partial ordering with memfn ptr cst [PR108104]

Here we're triggering an overzealous assert in unify during partial
ordering since the member function pointer constants are represented as
ordinary CONSTRUCTORs (with TYPE_PTRMEMFUNC_P TREE_TYPE) but the assert
expects COMPOUND_LITERAL_P constructors.

PR c++/108104

gcc/cp/ChangeLog:

* pt.cc (unify) <default>: Relax assert to accept any
CONSTRUCTOR parm, not just COMPOUND_LITERAL_P one.

gcc/testsuite/ChangeLog:

* g++.dg/template/ptrmem33.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/template/ptrmem33.C [new file with mode: 0644]