This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81796] New: error: no matching function for call to ‘S2::operator delete(void*)’
- From: "sbergman at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Aug 2017 13:05:17 +0000
- Subject: [Bug c++/81796] New: error: no matching function for call to ‘S2::operator delete(void*)’
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81796
Bug ID: 81796
Summary: error: no matching function for call to ‘S2::operator
delete(void*)’
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sbergman at redhat dot com
Target Milestone: ---
> $ g++ --version
> g++ (GCC) 8.0.0 20170810 (experimental)
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> $ cat test.cc
> #include <cstddef>
> struct S1 { virtual ~S1(); };
> struct S2: S1 {
> static void * operator new(std::size_t);
> static void operator delete(void *, std::size_t);
> };
>
> $ g++ -fsyntax-only test.cc
> test.cc:3:8: error: no matching function for call to ‘S2::operator delete(void*)’
> struct S2: S1 {
> ^~
> test.cc:5:17: note: candidate: ‘static void S2::operator delete(void*, std::size_t)’
> static void operator delete(void *, std::size_t);
> ^~~~~~~~
> test.cc:5:17: note: candidate expects 2 arguments, 1 provided