https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/148576
Alas reflection pushed p2719 out of C++26, so this PR changes the diagnostics to reflect that for now type aware allocation is functionally a clang extension. >From d86fea4e16dc9962f87a8969e74b62767476ec30 Mon Sep 17 00:00:00 2001 From: Oliver Hunt <oli...@apple.com> Date: Mon, 14 Jul 2025 00:26:08 -0700 Subject: [PATCH] [clang] Update diagnostics for type aware allocators Alas reflection pushed p2719 out of C++26, so this PR changes the diagnostics to reflect that for now type aware allocation is functionally a clang extension. --- .../clang/Basic/DiagnosticSemaKinds.td | 7 +- clang/lib/Sema/SemaDeclCXX.cpp | 8 +-- ...re-class-scoped-mismatched-constraints.cpp | 8 +-- clang/test/SemaCXX/type-aware-coroutines.cpp | 2 +- .../test/SemaCXX/type-aware-new-constexpr.cpp | 16 ++--- .../SemaCXX/type-aware-new-delete-arrays.cpp | 8 +-- ...are-new-delete-basic-free-declarations.cpp | 8 +-- ...new-delete-basic-in-class-declarations.cpp | 70 +++++++++---------- ...type-aware-new-delete-basic-resolution.cpp | 8 +-- .../type-aware-new-delete-qualifiers.cpp | 8 +-- ...-aware-new-delete-transparent-contexts.cpp | 6 +- .../type-aware-new-invalid-type-identity.cpp | 12 ++-- .../type-aware-placement-operators.cpp | 8 +-- 13 files changed, 81 insertions(+), 88 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 577adc30ba2fa..2ea9e46dadcdf 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10081,11 +10081,8 @@ def err_destroying_operator_delete_not_usual : Error< def err_type_aware_destroying_operator_delete : Error< "destroying delete is not permitted to be type aware">; -def ext_cxx26_type_aware_allocators : ExtWarn< - "type aware allocators are a C++2c extension">, InGroup<CXX26>; -def warn_cxx26_type_aware_allocators : Warning< - "type aware allocators are incompatible with C++ standards before C++2c">, - DefaultIgnore, InGroup<CXXPre26Compat>; +def warn_ext_type_aware_allocators : ExtWarn< + "type aware allocators are a clang extension">, InGroup<DiagGroup<"cxx-type-aware-allocators">>; def err_type_aware_allocator_missing_matching_operator : Error< "declaration of type aware %0 in %1 must have matching type aware %2" >; diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 5cc92ebb0171f..f60ab4f0da7a0 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -16541,12 +16541,8 @@ static inline bool CheckOperatorNewDeleteTypes( if (IsPotentiallyTypeAware) { // We don't emit this diagnosis for template instantiations as we will // have already emitted it for the original template declaration. - if (!FnDecl->isTemplateInstantiation()) { - unsigned DiagID = SemaRef.getLangOpts().CPlusPlus26 - ? diag::warn_cxx26_type_aware_allocators - : diag::ext_cxx26_type_aware_allocators; - SemaRef.Diag(FnDecl->getLocation(), DiagID); - } + if (!FnDecl->isTemplateInstantiation()) + SemaRef.Diag(FnDecl->getLocation(), diag::warn_ext_type_aware_allocators); if (OperatorKind == AllocationOperatorKind::New) { SizeParameterIndex = 1; diff --git a/clang/test/SemaCXX/type-aware-class-scoped-mismatched-constraints.cpp b/clang/test/SemaCXX/type-aware-class-scoped-mismatched-constraints.cpp index 57e6d953c2ad6..709635a1948ff 100644 --- a/clang/test/SemaCXX/type-aware-class-scoped-mismatched-constraints.cpp +++ b/clang/test/SemaCXX/type-aware-class-scoped-mismatched-constraints.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fsized-deallocation -faligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=1 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fno-sized-deallocation -faligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=0 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fsized-deallocation -fno-aligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=1 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fno-sized-deallocation -fno-aligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=0 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fsized-deallocation -faligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=1 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fno-sized-deallocation -faligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=0 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fsized-deallocation -fno-aligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=1 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fno-sized-deallocation -fno-aligned-allocation -Wno-non-c-typedef-for-linkage -DDEFAULT_DELETE=0 namespace std { template <class T> struct type_identity {}; diff --git a/clang/test/SemaCXX/type-aware-coroutines.cpp b/clang/test/SemaCXX/type-aware-coroutines.cpp index a54d37c47dbd9..198347ca86734 100644 --- a/clang/test/SemaCXX/type-aware-coroutines.cpp +++ b/clang/test/SemaCXX/type-aware-coroutines.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fcoroutines -fexceptions -Wall -Wpedantic +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fcoroutines -fexceptions -Wall -Wpedantic #include "Inputs/std-coroutine.h" diff --git a/clang/test/SemaCXX/type-aware-new-constexpr.cpp b/clang/test/SemaCXX/type-aware-new-constexpr.cpp index 105610cd103e6..e6461ff40d7d4 100644 --- a/clang/test/SemaCXX/type-aware-new-constexpr.cpp +++ b/clang/test/SemaCXX/type-aware-new-constexpr.cpp @@ -1,11 +1,11 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -faligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -faligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -fno-aligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -fno-aligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -faligned-allocation -fexperimental-new-constant-interpreter -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -faligned-allocation -fexperimental-new-constant-interpreter -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -fno-aligned-allocation -fexperimental-new-constant-interpreter -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -fno-aligned-allocation -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -faligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -faligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -faligned-allocation -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -faligned-allocation -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -fno-aligned-allocation -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -fno-aligned-allocation -fexperimental-new-constant-interpreter namespace std { diff --git a/clang/test/SemaCXX/type-aware-new-delete-arrays.cpp b/clang/test/SemaCXX/type-aware-new-delete-arrays.cpp index b1c73236476c4..37781d1529223 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-arrays.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-arrays.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -faligned-allocation -Wall -Wpedantic -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -faligned-allocation -Wall -Wpedantic -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -fno-aligned-allocation -Wall -Wpedantic -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -fno-aligned-allocation -Wall -Wpedantic +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -faligned-allocation -Wall -Wpedantic +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -faligned-allocation -Wall -Wpedantic +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -fno-aligned-allocation -Wall -Wpedantic +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -fno-aligned-allocation -Wall -Wpedantic namespace std { template <class T> struct type_identity {}; diff --git a/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp b/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp index c85b92718479a..e27e45d0e2f42 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-basic-free-declarations.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fsized-deallocation -faligned-allocation -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fno-sized-deallocation -faligned-allocation -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fno-sized-deallocation -fno-aligned-allocation -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fsized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -fsized-deallocation -faligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -fno-sized-deallocation -faligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -fno-sized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -fsized-deallocation -fno-aligned-allocation namespace std { template <class T> struct type_identity {}; diff --git a/clang/test/SemaCXX/type-aware-new-delete-basic-in-class-declarations.cpp b/clang/test/SemaCXX/type-aware-new-delete-basic-in-class-declarations.cpp index 34bd1d4206be1..af1a86f490c80 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-basic-in-class-declarations.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-basic-in-class-declarations.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify=expected,precxx26 %s -std=c++23 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 +// RUN: %clang_cc1 -triple arm64-apple-macosx -std=c++26 -fsyntax-only -verify=expected,clangext %s +// RUN: %clang_cc1 -triple arm64-apple-macosx -std=c++26 -Wno-cxx-type-aware-allocators -fsyntax-only -verify %s namespace std { template <class T> struct type_identity {}; @@ -13,24 +13,24 @@ using size_t = __SIZE_TYPE__; struct S { void *operator new(std::type_identity<S>, size_t, std::align_val_t); // #1 void operator delete(std::type_identity<S>, void *, size_t, std::align_val_t); // #2 - // precxx26-warning@#1 {{type aware allocators are a C++2c extension}} - // precxx26-warning@#2 {{type aware allocators are a C++2c extension}} + // clangext-warning@#1 {{type aware allocators are a clang extension}} + // clangext-warning@#2 {{type aware allocators are a clang extension}} void operator delete(S *, std::destroying_delete_t); }; template <typename T> struct S2 { void *operator new(std::type_identity<S2<T>>, size_t, std::align_val_t); // #3 void operator delete(std::type_identity<S2<T>>, void *, size_t, std::align_val_t); // #4 - // precxx26-warning@#3 {{type aware allocators are a C++2c extension}} - // precxx26-warning@#4 {{type aware allocators are a C++2c extension}} + // clangext-warning@#3 {{type aware allocators are a clang extension}} + // clangext-warning@#4 {{type aware allocators are a clang extension}} void operator delete(S2 *, std::destroying_delete_t); }; struct S3 { template <typename T> void *operator new(std::type_identity<T>, size_t, std::align_val_t); // #5 template <typename T> void operator delete(std::type_identity<T>, void *, size_t, std::align_val_t); // #6 - // precxx26-warning@#5 {{type aware allocators are a C++2c extension}} - // precxx26-warning@#6 {{type aware allocators are a C++2c extension}} + // clangext-warning@#5 {{type aware allocators are a clang extension}} + // clangext-warning@#6 {{type aware allocators are a clang extension}} void operator delete(S3 *, std::destroying_delete_t); }; @@ -38,34 +38,34 @@ struct S4 { template <typename T> void *operator new(std::type_identity<T>, size_t, std::align_val_t); // #7 template <typename T> void operator delete(std::type_identity<T>, void *, size_t, std::align_val_t); // #8 template <typename T> void operator delete(std::type_identity<T>, S4 *, std::destroying_delete_t, size_t, std::align_val_t); // #9 - // precxx26-warning@#7 {{type aware allocators are a C++2c extension}} - // precxx26-warning@#8 {{type aware allocators are a C++2c extension}} + // clangext-warning@#7 {{type aware allocators are a clang extension}} + // clangext-warning@#8 {{type aware allocators are a clang extension}} // expected-error@#9 {{destroying delete is not permitted to be type aware}} }; struct S5 { template <typename T> void operator delete(std::type_identity<T>, T *, size_t, std::align_val_t); // #10 // expected-error@#10 {{type aware 'operator delete' cannot take a dependent type as its 2nd parameter}} - // precxx26-warning@#10 {{type aware allocators are a C++2c extension}} + // clangext-warning@#10 {{type aware allocators are a clang extension}} }; struct S6 { template <typename T> void *operator new(std::type_identity<S6>, T, std::align_val_t); // #11 // expected-error@#11 {{type aware 'operator new' cannot take a dependent type as its 2nd parameter}} - // precxx26-warning@#11 {{type aware allocators are a C++2c extension}} + // clangext-warning@#11 {{type aware allocators are a clang extension}} template <typename T> void operator delete(std::type_identity<S6>, T, size_t, std::align_val_t); // #12 // expected-error@#12 {{type aware 'operator delete' cannot take a dependent type as its 2nd parameter}} - // precxx26-warning@#12 {{type aware allocators are a C++2c extension}} + // clangext-warning@#12 {{type aware allocators are a clang extension}} }; template <typename U> struct S7 { template <typename T> void *operator new(std::type_identity<T>, U, std::align_val_t); // #13 // expected-error@#13 {{type aware 'operator new' cannot take a dependent type as its 2nd parameter;}} - // precxx26-warning@#13 {{type aware allocators are a C++2c extension}} + // clangext-warning@#13 {{type aware allocators are a clang extension}} template <typename T> void operator delete(std::type_identity<T>, U, size_t, std::align_val_t); // #14 // expected-error@#14 {{type aware 'operator delete' cannot take a dependent type as its 2nd parameter;}} - // precxx26-warning@#14 {{type aware allocators are a C++2c extension}} + // clangext-warning@#14 {{type aware allocators are a clang extension}} template <typename T> void operator delete(std::type_identity<T>, S7 *, std::destroying_delete_t, U, std::align_val_t); // #15 // expected-error@#15 {{destroying delete is not permitted to be type aware}} void operator delete(S7 *, std::destroying_delete_t, U); // #16 @@ -80,10 +80,10 @@ void f() { struct S8 { template <typename T, typename U> void *operator new(std::type_identity<T>, U, std::align_val_t); // #17 // expected-error@#17 {{type aware 'operator new' cannot take a dependent type as its 2nd parameter;}} - // precxx26-warning@#17 {{type aware allocators are a C++2c extension}} + // clangext-warning@#17 {{type aware allocators are a clang extension}} template <typename T, typename U> void operator delete(std::type_identity<T>, U, size_t, std::align_val_t); // #18 // expected-error@#18 {{type aware 'operator delete' cannot take a dependent type as its 2nd parameter;}} - // precxx26-warning@#18 {{type aware allocators are a C++2c extension}} + // clangext-warning@#18 {{type aware allocators are a clang extension}} template <typename T, typename U> void operator delete(std::type_identity<T>, S8 *, std::destroying_delete_t, U, std::align_val_t); // #19 // expected-error@#19 {{destroying delete is not permitted to be type aware}} }; @@ -95,23 +95,23 @@ using UsingAlias = std::type_identity<float>; struct S9 { void *operator new(Alias<size_t>, std::align_val_t); template <typename T> void *operator new(Alias<std::type_identity<T>>, Alias<size_t>, std::align_val_t); // #20 - // precxx26-warning@#20 {{type aware allocators are a C++2c extension}} + // clangext-warning@#20 {{type aware allocators are a clang extension}} void *operator new(Alias<std::type_identity<int>>, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} template <typename T> void operator delete(Alias<std::type_identity<T>>, void *, size_t, std::align_val_t); // #21 - // precxx26-warning@#21{{type aware allocators are a C++2c extension}} + // clangext-warning@#21{{type aware allocators are a clang extension}} void operator delete(Alias<std::type_identity<int>>, void *, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} }; struct S10 { template <typename T> void *operator new(TypeIdentityAlias<T>, size_t, std::align_val_t); // #22 - // precxx26-warning@#22 {{type aware allocators are a C++2c extension}} + // clangext-warning@#22 {{type aware allocators are a clang extension}} void *operator new(TypeIdentityAlias<int>, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} template <typename T> void operator delete(TypeIdentityAlias<T>, void *, size_t, std::align_val_t); // #23 - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} void operator delete(TypeIdentityAlias<int>, void *, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} }; void test() { @@ -123,28 +123,28 @@ void test() { struct S11 { template <typename T> void *operator new(TypedefAlias, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} void *operator new(TypedefAlias, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} template <typename T> void operator delete(TypedefAlias, void *, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} void operator delete(TypedefAlias, void *, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} }; struct S12 { template <typename T> void *operator new(UsingAlias, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} void *operator new(UsingAlias, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} template <typename T> void operator delete(UsingAlias, void *, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} void operator delete(UsingAlias, void *, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} }; struct S13 { void *operator new(std::type_identity<S13>, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} void operator delete(std::type_identity<S13>, void*, size_t, std::align_val_t); - // precxx26-warning@-1 {{type aware allocators are a C++2c extension}} + // clangext-warning@-1 {{type aware allocators are a clang extension}} }; diff --git a/clang/test/SemaCXX/type-aware-new-delete-basic-resolution.cpp b/clang/test/SemaCXX/type-aware-new-delete-basic-resolution.cpp index 786899295f627..1ec03972d8fb6 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-basic-resolution.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-basic-resolution.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -faligned-allocation -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -faligned-allocation -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fsized-deallocation -fno-aligned-allocation -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -fexceptions -fno-sized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -faligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -faligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fsized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fno-sized-deallocation -fno-aligned-allocation namespace std { template <class T> struct type_identity {}; diff --git a/clang/test/SemaCXX/type-aware-new-delete-qualifiers.cpp b/clang/test/SemaCXX/type-aware-new-delete-qualifiers.cpp index af5386b25451f..e4262516057fc 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-qualifiers.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-qualifiers.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -DNO_TADD -std=c++26 -fsized-deallocation -faligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -DNO_TADD -std=c++26 -fno-sized-deallocation -faligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -DNO_TADD -std=c++26 -fno-sized-deallocation -fno-aligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -DNO_TADD -std=c++26 -fsized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -fsyntax-only -Wno-cxx-type-aware-allocators -verify %s -DNO_TADD -std=c++26 -fsized-deallocation -faligned-allocation +// RUN: %clang_cc1 -fsyntax-only -Wno-cxx-type-aware-allocators -verify %s -DNO_TADD -std=c++26 -fno-sized-deallocation -faligned-allocation +// RUN: %clang_cc1 -fsyntax-only -Wno-cxx-type-aware-allocators -verify %s -DNO_TADD -std=c++26 -fno-sized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -fsyntax-only -Wno-cxx-type-aware-allocators -verify %s -DNO_TADD -std=c++26 -fsized-deallocation -fno-aligned-allocation namespace std { template <class T> struct type_identity { typedef T type; diff --git a/clang/test/SemaCXX/type-aware-new-delete-transparent-contexts.cpp b/clang/test/SemaCXX/type-aware-new-delete-transparent-contexts.cpp index 30fea464a8dc5..3de6adb512b73 100644 --- a/clang/test/SemaCXX/type-aware-new-delete-transparent-contexts.cpp +++ b/clang/test/SemaCXX/type-aware-new-delete-transparent-contexts.cpp @@ -2,9 +2,9 @@ // RUN: mkdir %t // RUN: split-file %s %t -// RUN: %clang_cc1 -fsyntax-only -verify %t/testing.cpp -std=c++26 -fexceptions -DTRANSPARENT_DECL=0 -// RUN: %clang_cc1 -fsyntax-only -verify %t/testing.cpp -std=c++26 -fexceptions -DTRANSPARENT_DECL=1 -// RUN: %clang_cc1 -fsyntax-only -verify %t/module_testing.cppm -std=c++26 -fexceptions -DTRANSPARENT_DECL=2 +// RUN: %clang_cc1 -fsyntax-only -verify %t/testing.cpp -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -DTRANSPARENT_DECL=0 +// RUN: %clang_cc1 -fsyntax-only -verify %t/testing.cpp -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -DTRANSPARENT_DECL=1 +// RUN: %clang_cc1 -fsyntax-only -verify %t/module_testing.cppm -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -DTRANSPARENT_DECL=2 //--- module_testing.cppm // expected-no-diagnostics diff --git a/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp b/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp index d0242e43edcf1..7b92ed92b2b6d 100644 --- a/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp +++ b/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=0 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=1 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=2 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=3 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=4 -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -std=c++26 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=0 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=1 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=2 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=3 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=4 +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-cxx-type-aware-allocators -std=c++26 namespace std { #if !defined(INVALID_TYPE_IDENTITY_VERSION) diff --git a/clang/test/SemaCXX/type-aware-placement-operators.cpp b/clang/test/SemaCXX/type-aware-placement-operators.cpp index b64832a76e20b..ad3f645cf9ce9 100644 --- a/clang/test/SemaCXX/type-aware-placement-operators.cpp +++ b/clang/test/SemaCXX/type-aware-placement-operators.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fsized-deallocation -faligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fno-sized-deallocation -faligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fno-sized-deallocation -fno-aligned-allocation -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -fexceptions -fcxx-exceptions -fsized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fsized-deallocation -faligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fno-sized-deallocation -faligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fno-sized-deallocation -fno-aligned-allocation +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++26 -Wno-cxx-type-aware-allocators -fexceptions -fcxx-exceptions -fsized-deallocation -fno-aligned-allocation namespace std { template <class T> struct type_identity {}; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits