[PATCH] D51955: Create infrastructure for defining and testing feature test macros

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 11 15:34:11 PDT 2018


mclow.lists created this revision.
mclow.lists added reviewers: ldionne, EricWF.
Herald added a reviewer: jfb.
Herald added a subscriber: jfb.
mclow.lists edited the summary of this revision.

In P0941 <https://wg21.link/p0941>, the committee standardized a bunch of feature test macros.
[ I think it's a bad idea, but whatever. ]

This patch puts the existing libc++ feature test macros in `<version>`, where P0941 specifies, and makes sure that all the correct headers include `<version>`. It also introduces a full set of tests, one per header file that might get something defined.

At the moment, most of those tests are empty, since libc++ does not define many feature test macros.
But now it's easy to add more. Put them in `<version>` and update the appropriate tests. Helpfully, the list is at the top of each of the test files.


https://reviews.llvm.org/D51955

Files:
  include/algorithm
  include/any
  include/array
  include/atomic
  include/bit
  include/chrono
  include/cmath
  include/complex
  include/cstddef
  include/deque
  include/exception
  include/filesystem
  include/forward_list
  include/functional
  include/iomanip
  include/iterator
  include/list
  include/map
  include/memory
  include/mutex
  include/new
  include/numeric
  include/optional
  include/regex
  include/scoped_allocator
  include/set
  include/shared_mutex
  include/string
  include/string_view
  include/tuple
  include/type_traits
  include/unordered_map
  include/unordered_set
  include/utility
  include/variant
  include/vector
  include/version
  test/std/language.support/support.limits/support.limits.general/algorithm.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/any.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/array.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/atomic.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/chrono.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/cmath.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/complex.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/concepts.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/cstddef.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/deque.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/exception.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/execution.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/filesystem.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/forward_list.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/functional.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/iomanip.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/iterator.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/list.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/map.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/mutex.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/new.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/numeric.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/optional.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/regex.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/set.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/shared_mutex.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/string.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/string_view.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/tuple.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/unordered_map.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/unordered_set.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/utility.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/variant.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/vector.version.pass.cpp
  test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51955.164987.patch
Type: text/x-patch
Size: 70638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180911/be0c840e/attachment-0001.bin>


More information about the cfe-commits mailing list