nir/tests: do not use designated initializers in c++ code
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 1 Apr 2022 08:34:11 +0000 (10:34 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 5 Apr 2022 16:58:56 +0000 (16:58 +0000)
Designated initializers require C++20, which is a bit easier said than
done to support well across meson versions. Let's avoid using them
for now instead.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15706>

src/compiler/nir/tests/core_tests.cpp

index d243396..0d5820e 100644 (file)
@@ -80,8 +80,7 @@ nir_core_test::shader_contains_def(nir_ssa_def *def)
    nir_foreach_block(block, b->impl) {
       nir_foreach_instr(instr, block) {
          struct contains_def_state state = {
-            .def = def,
-            .found = false,
+            def, false
          };
          nir_foreach_ssa_def(instr, contains_def_cb, &state);
          if (state.found)