Skip to content

Member operator new and operator delete should reject explicit object parameters #82249

Closed
@Rajveer100

Description

@Rajveer100

These functions are members, but they are implicitly static members as in this draft, which means they shouldn't be allowed to have explicit object parameters.

Snippet:

#include <new>
#include <memory>

struct S {
    void *operator new(this unsigned long);
    void operator delete(this void*);
    void operator delete(this S*, std::destroying_delete_t);
};

GodBolt

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions