[clang] [clang][NFC] Refactor `clang/test/SemaCXX/type-traits.cpp` to use modern `static_assert` (PR #77584)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 10 06:23:35 PST 2024
================
@@ -214,56 +212,56 @@ struct HasVirtBase : virtual ACompleteType {};
void is_pod()
{
- { int arr[T(__is_pod(int))]; }
- { int arr[T(__is_pod(Enum))]; }
- { int arr[T(__is_pod(POD))]; }
- { int arr[T(__is_pod(Int))]; }
- { int arr[T(__is_pod(IntAr))]; }
- { int arr[T(__is_pod(Statics))]; }
- { int arr[T(__is_pod(Empty))]; }
- { int arr[T(__is_pod(EmptyUnion))]; }
- { int arr[T(__is_pod(Union))]; }
- { int arr[T(__is_pod(HasFunc))]; }
- { int arr[T(__is_pod(HasOp))]; }
- { int arr[T(__is_pod(HasConv))]; }
- { int arr[T(__is_pod(HasAssign))]; }
- { int arr[T(__is_pod(IntArNB))]; }
- { int arr[T(__is_pod(HasAnonymousUnion))]; }
- { int arr[T(__is_pod(Vector))]; }
- { int arr[T(__is_pod(VectorExt))]; }
- { int arr[T(__is_pod(Derives))]; }
- { int arr[T(__is_pod(DerivesAr))]; }
- { int arr[T(__is_pod(DerivesArNB))]; }
- { int arr[T(__is_pod(DerivesEmpty))]; }
- { int arr[T(__is_pod(HasPriv))]; }
- { int arr[T(__is_pod(HasProt))]; }
- { int arr[T(__is_pod(DerivesHasPriv))]; }
- { int arr[T(__is_pod(DerivesHasProt))]; }
-
- { int arr[F(__is_pod(HasCons))]; }
- { int arr[F(__is_pod(HasCopyAssign))]; }
- { int arr[F(__is_pod(HasMoveAssign))]; }
- { int arr[F(__is_pod(HasDest))]; }
- { int arr[F(__is_pod(HasRef))]; }
- { int arr[F(__is_pod(HasVirt))]; }
- { int arr[F(__is_pod(DerivesHasCons))]; }
- { int arr[F(__is_pod(DerivesHasCopyAssign))]; }
- { int arr[F(__is_pod(DerivesHasMoveAssign))]; }
- { int arr[F(__is_pod(DerivesHasDest))]; }
- { int arr[F(__is_pod(DerivesHasRef))]; }
- { int arr[F(__is_pod(DerivesHasVirt))]; }
- { int arr[F(__is_pod(NonPOD))]; }
- { int arr[F(__is_pod(HasNonPOD))]; }
- { int arr[F(__is_pod(NonPODAr))]; }
- { int arr[F(__is_pod(NonPODArNB))]; }
- { int arr[F(__is_pod(void))]; }
- { int arr[F(__is_pod(cvoid))]; }
-// { int arr[F(__is_pod(NonPODUnion))]; }
-
- { int arr[T(__is_pod(ACompleteType))]; }
- { int arr[F(__is_pod(AnIncompleteType))]; } // expected-error {{incomplete type}}
- { int arr[F(__is_pod(AnIncompleteType[]))]; } // expected-error {{incomplete type}}
- { int arr[F(__is_pod(AnIncompleteType[1]))]; } // expected-error {{incomplete type}}
+ static_assert(__is_pod(int), "");
----------------
cor3ntin wrote:
Maybe we should compile with `-Wno-c++17-extensions` and get rid of the empty message
https://github.com/llvm/llvm-project/pull/77584
More information about the cfe-commits
mailing list