diff --git a/libcxx/cmake/caches/Generic-cxx20.cmake b/libcxx/cmake/caches/Generic-cxx20.cmake --- a/libcxx/cmake/caches/Generic-cxx20.cmake +++ b/libcxx/cmake/caches/Generic-cxx20.cmake @@ -1,2 +1,2 @@ -set(LIBCXX_TEST_PARAMS "std=c++2a" CACHE STRING "") +set(LIBCXX_TEST_PARAMS "std=c++20" CACHE STRING "") set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "") diff --git a/libcxx/docs/TestingLibcxx.rst b/libcxx/docs/TestingLibcxx.rst --- a/libcxx/docs/TestingLibcxx.rst +++ b/libcxx/docs/TestingLibcxx.rst @@ -126,7 +126,7 @@ .. option:: std= - **Values**: c++03, c++11, c++14, c++17, c++2a, c++2b + **Values**: c++03, c++11, c++14, c++17, c++20, c++2b Change the standard version used when building the tests. diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp @@ -11,7 +11,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++17, c++2a +// REQUIRES: c++03 || c++11 // UNSUPPORTED: sanitizer-new-delete #include diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp @@ -11,7 +11,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++17, c++2a +// REQUIRES: c++03 || c++11 // UNSUPPORTED: sanitizer-new-delete #include diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp b/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp b/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp b/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // type_traits diff --git a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp --- a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp +++ b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // [utility.underlying], to_underlying // template diff --git a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp --- a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp +++ b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // [utility.underlying], to_underlying // template diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -8,7 +8,6 @@ from libcxx.test.dsl import * -_allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++2a', 'c++2b'] _warningFlags = [ '-Werror', '-Wall', @@ -38,14 +37,28 @@ '-Wno-unused-local-typedef', ] +_allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++20', 'c++2b'] +def getStdFlag(cfg, std): + fallbacks = { + 'c++11': 'c++0x', + 'c++14': 'c++1y', + 'c++17': 'c++1z', + 'c++20': 'c++2a', + } + if hasCompileFlag(cfg, '-std='+std): + return '-std='+std + if fallbacks[std] and hasCompileFlag(cfg, '-std='+fallbacks[std]): + return '-std='+fallbacks[std] + return None + DEFAULT_PARAMETERS = [ # Core parameters of the test suite Parameter(name='std', choices=_allStandards, type=str, help="The version of the standard to compile the test suite with.", - default=lambda cfg: next(s for s in reversed(_allStandards) if hasCompileFlag(cfg, '-std='+s)), + default=lambda cfg: next(s for s in reversed(_allStandards) if getStdFlag(cfg, s)), actions=lambda std: [ AddFeature(std), - AddCompileFlag('-std={}'.format(std)), + AddCompileFlag(lambda cfg: getStdFlag(cfg, std)), ]), Parameter(name='enable_exceptions', choices=[True, False], type=bool, default=True,