Skip to content

Spurious uninitialized value warning post P2719 merge #135668

@ojhunt

Description

@ojhunt

Reported and minimized by @Sterling-Augustine

extern void* GetMem();

class MyFileMod {
 public:
  MyFileMod(int x, int y) {}
  void SetNext() {}
  friend class Foo;
 private:
  static void * operator new(unsigned long size) { return GetMem(); }
  static void * operator new[](unsigned long size) { return GetMem() ; }
  static void * operator new(unsigned long, void *p) { return p ; }
  static void * operator new[](unsigned long, void *p) { return p ; }
  static void operator delete(void *p) {  }
  static void operator delete[](void *p) {  }
  static void operator delete(void*, void*) {}
  static void operator delete[](void*, void*) {}
};

MyFileMod* f;

class Foo {
 public:
void Bar() {
            MyFileMod *new_section = new MyFileMod(0, 0) ;
            new_section->SetNext() ;
}
};

Metadata

Metadata

Assignees

Labels

c++26clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions