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
Differential D109711
[libc++][test] Remove disable_missing_braces_warning.h from tests jloser on Sep 13 2021, 11:30 AM. Authored by
Details
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. Comment Actions Remove rest of disable_missing_braces_warning.h from other tests. 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? |