]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: xobj fn call without obj [PR115783]
authorPatrick Palka <ppalka@redhat.com>
Fri, 19 Jul 2024 17:48:12 +0000 (13:48 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 19 Jul 2024 17:48:12 +0000 (13:48 -0400)
commit2ee70c9f83a1033f2897a35bff9e9ffdd03cc651
treee9d43cb50e11f204e2bc37c8aeb59389ead29c96
parent9116490c1b03dac18f10e42df03731a3aed0b4e9
c++: xobj fn call without obj [PR115783]

The code path for rejecting an object-less call to a non-static member
function should also consider xobj member functions (so that we correctly
reject the below calls with a "cannot call member function without object"
diagnostic).

PR c++/115783

gcc/cp/ChangeLog:

* call.cc (build_new_method_call): Generalize METHOD_TYPE
check to DECL_OBJECT_MEMBER_FUNCTION_P.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/explicit-obj-diagnostics11.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/call.cc
gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics11.C [new file with mode: 0644]