[clang] [Clang] Add tests for ref-qualified operator new (PR #215644)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 12 04:39:02 PDT 2026
================
@@ -54,4 +54,11 @@ struct B {
void operator delete(void*) volatile; //expected-error {{static member function cannot have 'volatile' qualifier}}
void operator delete[](void*) volatile; //expected-error {{static member function cannot have 'volatile' qualifier}}
};
-}
+ struct RefQualifierLValue {
+ void* operator new(size_t bytes) &; // expected-error {{static member function cannot have '&' qualifier}}
+ };
+
+ struct RefQualifierRValue {
+ void* operator new(size_t bytes) &&; // expected-error {{static member function cannot have '&&' qualifier}}
+ };
+ } // namespace GH79748
----------------
nehaGautam07 wrote:
Thanks for the review. Added a newline as suggested.
https://github.com/llvm/llvm-project/pull/215644
More information about the cfe-commits
mailing list