[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 04:06:04 PST 2024


================
@@ -37,3 +37,10 @@ void instantiateArrayDecay() {
   int a[1];
   arrayDecay(a);
 }
+
+namespace GH79748 {
+typedef decltype(sizeof(0)) size_t;
+struct A {
+  void* operator new(size_t bytes) const; //expected-error {{static member function cannot have 'const' qualifier}}
----------------
cor3ntin wrote:

And maybe delete, new[], delete[]

https://github.com/llvm/llvm-project/pull/80327


More information about the cfe-commits mailing list