[libcxx-commits] [PATCH] D117174: [libc++][test] Run clang-tidy during CI

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 11 07:27:02 PST 2022


Quuxplusone requested changes to this revision.
Quuxplusone added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/test/libcxx/clang_tidy.sh.cpp:9-12
+// UNSUPPORTED: !has-clang-tidy
+// XFAIL: modules
+// RUN: clang-tidy %s --warnings-as-errors=* -header-filter=.* -- -Wno-unknown-warning-option %{compile_flags}
+// -------------------------------------------------------------- ^ ignore GCC warnings unknown to clang
----------------
> `XFAIL: modules`
What's the problem with modules? (Preferably in the form of an English explanation //plus// a link to the failing buildkite.)


================
Comment at: libcxx/test/libcxx/clang_tidy.sh.cpp:12-13
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-W#warnings"
+
----------------
philnik wrote:
> Quuxplusone wrote:
> > What does this pragma do, and what goes wrong if you omit it?
> It ignores `#warnings` warnings. This test also checks `<ext/hash_map>` and `<ext/hash_set>`, which warn, because they have been replaced by `<unordered_map>` and `<unordered_set>`.
The right way to do this is
```
// Prevent <ext/hash_map> from generating deprecated warnings for this test.
#if defined(__DEPRECATED)
#    undef __DEPRECATED
#endif
```
Look at some of the other generated header tests for inspiration.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117174/new/

https://reviews.llvm.org/D117174



More information about the libcxx-commits mailing list