c++: ICE with operator delete [PR104846]
This is an ICE-on-invalid with "auto operator delete[] (void *)" whose
return type must be void. The return type is checked in coerce_delete_type
but we never got there in this test, because we took the wrong path in
grokdeclarator, set type to error_mark_node, ended up creating a FIELD_DECL
with build_decl, and confused grokmethod by giving it a FIELD_DECL.
Fixed by not taking the data member path for a FUNCTION_TYPE.
PR c++/104846
gcc/cp/ChangeLog:
* decl.cc (grokdeclarator): Check FUNC_OR_METHOD_TYPE_P before giving
data member errors.
gcc/testsuite/ChangeLog:
* g++.dg/init/delete5.C: New test.