This revision was automatically updated to reflect the committed changes. Closed by commit rGc6824883cc9d: [AST][SVE] Treat built-in SVE types as trivial (authored by rsandifo-arm).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76692/new/ https://reviews.llvm.org/D76692 Files: clang/lib/AST/Type.cpp clang/test/SemaCXX/sizeless-1.cpp Index: clang/test/SemaCXX/sizeless-1.cpp =================================================================== --- clang/test/SemaCXX/sizeless-1.cpp +++ clang/test/SemaCXX/sizeless-1.cpp @@ -516,6 +516,7 @@ _Static_assert(!__is_literal(svint8_t), ""); _Static_assert(__is_pod(svint8_t), ""); _Static_assert(!__is_polymorphic(svint8_t), ""); + _Static_assert(__is_trivial(svint8_t), ""); _Static_assert(__is_object(svint8_t), ""); _Static_assert(!__is_arithmetic(svint8_t), ""); _Static_assert(!__is_floating_point(svint8_t), ""); Index: clang/lib/AST/Type.cpp =================================================================== --- clang/lib/AST/Type.cpp +++ clang/lib/AST/Type.cpp @@ -2249,6 +2249,9 @@ if ((*this)->isArrayType()) return Context.getBaseElementType(*this).isTrivialType(Context); + if ((*this)->isSizelessBuiltinType()) + return true; + // Return false for incomplete types after skipping any incomplete array // types which are expressly allowed by the standard and thus our API. if ((*this)->isIncompleteType())
Index: clang/test/SemaCXX/sizeless-1.cpp =================================================================== --- clang/test/SemaCXX/sizeless-1.cpp +++ clang/test/SemaCXX/sizeless-1.cpp @@ -516,6 +516,7 @@ _Static_assert(!__is_literal(svint8_t), ""); _Static_assert(__is_pod(svint8_t), ""); _Static_assert(!__is_polymorphic(svint8_t), ""); + _Static_assert(__is_trivial(svint8_t), ""); _Static_assert(__is_object(svint8_t), ""); _Static_assert(!__is_arithmetic(svint8_t), ""); _Static_assert(!__is_floating_point(svint8_t), ""); Index: clang/lib/AST/Type.cpp =================================================================== --- clang/lib/AST/Type.cpp +++ clang/lib/AST/Type.cpp @@ -2249,6 +2249,9 @@ if ((*this)->isArrayType()) return Context.getBaseElementType(*this).isTrivialType(Context); + if ((*this)->isSizelessBuiltinType()) + return true; + // Return false for incomplete types after skipping any incomplete array // types which are expressly allowed by the standard and thus our API. if ((*this)->isIncompleteType())
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits