c++: Fix ICE diagnosing incomplete type of overloaded function set [PR98356]
commit940586a63586941a9f2b973491afc8a15a96c98b
authorNathaniel Shead <nathanieloshead@gmail.com>
Mon, 4 Mar 2024 14:59:41 +0000 (5 01:59 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Thu, 7 Mar 2024 10:59:32 +0000 (7 21:59 +1100)
tree0ee9cd379e30cd78ca87beddcf386363bd61b780
parent77772f8a3da8ea30066d2201f8148714a8e89da5
c++: Fix ICE diagnosing incomplete type of overloaded function set [PR98356]

In the linked PR the result of 'get_first_fn' is a USING_DECL against
the template parameter, to be filled in on instantiation. But we don't
actually need to get the first set of the member functions: it's enough
to know that we have a (possibly overloaded) member function at all.

PR c++/98356

gcc/cp/ChangeLog:

* typeck2.cc (cxx_incomplete_type_diagnostic): Don't assume
'member' will be a FUNCTION_DECL (or something like it).

gcc/testsuite/ChangeLog:

* g++.dg/pr98356.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/typeck2.cc
gcc/testsuite/g++.dg/pr98356.C [new file with mode: 0644]