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

Reply via email to