[all-commits] [llvm/llvm-project] bd4417: [libc++] Use -I instead of -isystem to include hea...

philnik777 via All-commits all-commits at lists.llvm.org
Thu Mar 3 04:20:08 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bd44174547aaf0b491039a5a71d967e1471b6d87
      https://github.com/llvm/llvm-project/commit/bd44174547aaf0b491039a5a71d967e1471b6d87
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2022-03-03 (Thu, 03 Mar 2022)

  Changed paths:
    M libcxx/.clang-tidy
    M libcxx/include/__config
    M libcxx/include/__config_site.in
    M libcxx/include/__iterator/iterator_traits.h
    M libcxx/include/__locale
    M libcxx/include/ext/__hash
    M libcxx/test/configs/apple-libc++-shared.cfg.in
    M libcxx/test/configs/ibm-libc++-shared.cfg.in
    M libcxx/test/configs/llvm-libc++-mingw.cfg.in
    M libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
    M libcxx/test/configs/llvm-libc++-shared-gcc.cfg.in
    M libcxx/test/configs/llvm-libc++-shared.cfg.in
    M libcxx/test/configs/llvm-libc++-static-clangcl.cfg.in
    M libcxx/test/configs/llvm-libc++-static.cfg.in
    M libcxx/test/libcxx/clang_tidy.sh.cpp
    M libcxx/test/libcxx/containers/gnu_cxx/hash_map.pass.cpp
    M libcxx/test/libcxx/containers/gnu_cxx/hash_map_name_lookup.pass.cpp
    M libcxx/test/libcxx/containers/gnu_cxx/hash_set.pass.cpp
    M libcxx/test/libcxx/containers/gnu_cxx/hash_set_name_lookup.pass.cpp
    M libcxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
    M libcxx/test/libcxx/double_include.sh.cpp
    M libcxx/test/libcxx/extensions/hash/specializations.pass.cpp
    M libcxx/test/libcxx/memory/trivial_abi/shared_ptr_arg.pass.cpp
    M libcxx/test/libcxx/memory/trivial_abi/unique_ptr_arg.pass.cpp
    M libcxx/test/libcxx/memory/trivial_abi/unique_ptr_array.pass.cpp
    M libcxx/test/libcxx/memory/trivial_abi/unique_ptr_destruction_order.pass.cpp
    M libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
    M libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
    M libcxx/test/libcxx/min_max_macros.compile.pass.cpp
    M libcxx/test/libcxx/nasty_macros.compile.pass.cpp
    M libcxx/test/libcxx/no_assert_include.compile.pass.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp
    M libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
    M libcxx/utils/generate_header_tests.py
    M libcxx/utils/libcxx/test/config.py
    M libcxx/utils/libcxx/test/params.py
    M libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
    M libcxxabi/test/configs/apple-libc++abi-shared.cfg.in
    M libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in

  Log Message:
  -----------
  [libc++] Use -I instead of -isystem to include headers in the test suite

Using -isystem marks the headers as system headers, which means that we
don't actually get all the warnings that we'd normally get if we included
the headers as user headers.

The goal of the test suite is normally to mirror as closely as possible
how users would use the library. Technically, this change goes against
that philosophy, since users should be using `-isystem` (if they ever
need to specify the libc++ path explicitly, which should be a rare
occurence). However, I believe fishing out additional warnings from
the headers provides more value, hence this change. Ideally, we'd be
able to still use `-isystem`, but instruct Clang to still emit warnings
from the libc++ headers (e.g. we could tell Clang to emit warnings in
any file inside `<...>/usr/include/c++/v1`).

Reviewed By: #libc, ldionne, #libc_abi

Spies: Mordante, EricWF, mstorsjo, mgorny, aheejin, arichardson, philnik, jloser, libcxx-commits

Differential Revision: https://reviews.llvm.org/D118616




More information about the All-commits mailing list