[Bug c++/126785] New: delete with void* should be rejected when using -pedantic-errors

luigighiron at gmail dot com via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126785

            Bug ID: 126785
           Summary: delete with void* should be rejected when using
                    -pedantic-errors
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

GCC incorrectly accepts the following with -pedantic-errors:

int main(){
    void*p=0;
    delete p;
}

void* is not a "pointer to object type", so this is invalid and should be
rejected. Clang correctly rejects this with -pedantic-errors.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.