================ @@ -350,3 +350,22 @@ namespace ZeroInit { static_assert(b.f[0] == 0.0, ""); static_assert(b.f[1] == 0.0, ""); } + +namespace StringZeroFill { + struct A { + char c[12]; + }; + constexpr A a = { "abc" }; + static_assert(a.c[0] == 'a', ""); + static_assert(a.c[1] == 'b', ""); + static_assert(a.c[2] == 'c', ""); + static_assert(a.c[3] == '\0', ""); ---------------- shafik wrote:
Shouldn't we just test all the bytes? It is small enough. https://github.com/llvm/llvm-project/pull/66862 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits