Several tests include disable_missing_braces_warning.h but do not need
to. Remove the include.
Inspired from discussion at https://reviews.llvm.org/D109668
Paths
| Differential D109711
[libc++][test] Remove disable_missing_braces_warning.h from tests ClosedPublic Authored by jloser on Sep 13 2021, 11:30 AM.
Details
Summary Several tests include disable_missing_braces_warning.h but do not need Inspired from discussion at https://reviews.llvm.org/D109668
Diff Detail
Event TimelineComment Actions If buildkite is actually OK with this, then I'm OK with it. But I assume that buildkite would not be OK with this as-is; I assume it'll produce that warning diagnostic. But I think we should fix the warning appropriately, e.g. by changing const std::array<long, 5> arr = {4, 5, 6, 7, 8}; to const std::array<long, 5> arr = {{4, 5, 6, 7, 8}};. I believe such changes will be trivially easy, except for apply_extended_types.pass.cpp, where the missing braces are inside a template that's used sometimes with array (which needs double braces) and sometimes with tuple (which needs single braces). I don't understand why you changed only these few tests. E.g. why not any of the tests under std/containers/sequences/array/? and why not std/iterators/iterator.range/begin-end.pass.cpp? Comment Actions LGTM. But I too would prefer remove all no longer needed #include "disable_missing_braces_warning.h" in this commit and remove the then obsolete header. @Quuxplusone Am I missing something? AFAIK const std::array<long, 5> arr = {4, 5, 6, 7, 8}; is valid C++11. Comment Actions
It's definitely valid, but I had assumed (wrongly, it seems) that it would still trigger a non-fatal warning on Clang and/or GCC, which would have been the point of the header: to avoid that non-fatal warning.
So yeah, @jloser, can we see what happens if you just git rm disable_missing_braces_warning.h and remove all its uses? I now predict that we'll see buildkite totally happy with that. Comment Actions Agreed with the other reviewers, please try removing disable_missing_braces_warning,h entirely. This revision now requires changes to proceed.Sep 20 2021, 10:27 AM jloser retitled this revision from [libc++][test] Remove disable_missing_braces_warning.h from few tests to [libc++][test] Remove disable_missing_braces_warning.h from tests. Comment ActionsRemove rest of disable_missing_braces_warning.h from other tests. This revision is now accepted and ready to land.Sep 20 2021, 1:54 PM Comment Actions
CI is failing in the runtimes build (https://buildkite.com/llvm-project/libcxx-ci/builds/5444#eabe837f-7b55-4767-a14b-24ef963ad3dc) but this looks unrelated to my changes. I didn't touch this test so its behavior should be unchanged. Safe to land this, or what would you like me to do? This revision was landed with ongoing or failed builds.Sep 22 2021, 1:00 PM Closed by commit rG9fb3669429a8: [libc++][test] Remove disable_missing_braces_warning.h from tests (authored by • joe_loser). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 374333 libcxx/test/std/containers/sequences/array/array.cons/deduct.fail.cpp
libcxx/test/std/containers/sequences/array/array.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/array/array.cons/implicit_copy.pass.cpp
libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp
libcxx/test/std/containers/sequences/array/array.data/data_const.pass.cpp
libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
libcxx/test/std/containers/sequences/array/array.fill/fill.pass.cpp
libcxx/test/std/containers/sequences/array/array.size/size.pass.cpp
libcxx/test/std/containers/sequences/array/array.special/swap.pass.cpp
libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
libcxx/test/std/containers/sequences/array/array.swap/swap.pass.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get.pass.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get_const.pass.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get_const_rv.pass.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get_rv.pass.cpp
libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
libcxx/test/std/containers/sequences/array/at.pass.cpp
libcxx/test/std/containers/sequences/array/at_const.pass.cpp
libcxx/test/std/containers/sequences/array/compare.fail.cpp
libcxx/test/std/containers/sequences/array/compare.pass.cpp
libcxx/test/std/containers/sequences/array/front_back.pass.cpp
libcxx/test/std/containers/sequences/array/front_back_const.pass.cpp
libcxx/test/std/containers/sequences/array/indexing.pass.cpp
libcxx/test/std/containers/sequences/array/indexing_const.pass.cpp
libcxx/test/std/containers/sequences/array/iterators.pass.cpp
libcxx/test/std/containers/views/span.cons/stdarray.pass.cpp
libcxx/test/std/iterators/iterator.range/begin-end.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/apply_extended_types.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
libcxx/test/support/disable_missing_braces_warning.h
|