c++: Check if allocation functions are xobj members [PR114078]
commitcf51fe706ea0219beb5bb85e81606d372ca9635e
authorNathaniel Shead <nathanieloshead@gmail.com>
Sat, 20 Apr 2024 05:08:02 +0000 (20 15:08 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Tue, 23 Apr 2024 05:59:54 +0000 (23 15:59 +1000)
tree38a2b2bab4a0f4f0999aa3d24d3b61de58d4cd3a
parent77e114bb0dc03d1df7f84221e3132d19030c34b4
c++: Check if allocation functions are xobj members [PR114078]

A class allocation member function is implicitly 'static' by
[class.free] p3, so cannot have an explicit object parameter.

PR c++/114078

gcc/cp/ChangeLog:

* decl.cc (grokdeclarator): Check allocation functions for xobj
parameters.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/decl.cc
gcc/testsuite/g++.dg/cpp23/explicit-obj-ops-alloc.C [new file with mode: 0644]