Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ typedef __char32_t char32_t;
# define _LIBCPP_DEPRECATED_(m)
# endif

# if defined(__DEPRECATED) && __DEPRECATED && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 1
# else
# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0
# endif

# if !defined(_LIBCPP_CXX03_LANG)
# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
# else
Expand Down
14 changes: 3 additions & 11 deletions libcxx/include/ccomplex
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,10 @@
# pragma GCC system_header
# endif

# if _LIBCPP_STD_VER >= 20

using __standard_header_ccomplex
_LIBCPP_DEPRECATED_("removed in C++20. Include <complex> instead.") _LIBCPP_NODEBUG = void;
using __use_standard_header_ccomplex _LIBCPP_NODEBUG = __standard_header_ccomplex;

# elif _LIBCPP_STD_VER >= 17

using __standard_header_ccomplex _LIBCPP_DEPRECATED_("Include <complex> instead.") _LIBCPP_NODEBUG = void;
using __use_standard_header_ccomplex _LIBCPP_NODEBUG = __standard_header_ccomplex;

# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
# warning <ccomplex> is deprecated in C++17 and removed in C++20. Include <complex> instead.
# endif

#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

#endif // _LIBCPP_CCOMPLEX
9 changes: 3 additions & 6 deletions libcxx/include/ciso646
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@
# pragma GCC system_header
# endif

# if _LIBCPP_STD_VER >= 20

using __standard_header_ciso646
_LIBCPP_DEPRECATED_("removed in C++20. Include <version> instead.") _LIBCPP_NODEBUG = void;
using __use_standard_header_ciso646 _LIBCPP_NODEBUG = __standard_header_ciso646;

# if _LIBCPP_STD_VER >= 20 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
# warning <ciso646> is removed in C++20. Include <version> instead.
# endif

#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

#endif // _LIBCPP_CISO646
13 changes: 3 additions & 10 deletions libcxx/include/cstdalign
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,10 @@ Macros:
# undef __alignof_is_defined
# define __alignof_is_defined 1

# if _LIBCPP_STD_VER >= 20

using __standard_header_cstdalign _LIBCPP_DEPRECATED_("removed in C++20.") _LIBCPP_NODEBUG = void;
using __use_standard_header_cstdalign _LIBCPP_NODEBUG = __standard_header_cstdalign;

# elif _LIBCPP_STD_VER >= 17

using __standard_header_cstdalign _LIBCPP_DEPRECATED _LIBCPP_NODEBUG = void;
using __use_standard_header_cstdalign _LIBCPP_NODEBUG = __standard_header_cstdalign;

# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
# warning <cstdalign> is deprecated in C++17 and removed in C++20.
# endif

#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

#endif // _LIBCPP_CSTDALIGN
13 changes: 3 additions & 10 deletions libcxx/include/cstdbool
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,10 @@ Macros:
# undef __bool_true_false_are_defined
# define __bool_true_false_are_defined 1

# if _LIBCPP_STD_VER >= 20

using __standard_header_cstdbool _LIBCPP_DEPRECATED_("removed in C++20.") _LIBCPP_NODEBUG = void;
using __use_standard_header_cstdbool _LIBCPP_NODEBUG = __standard_header_cstdbool;

# elif _LIBCPP_STD_VER >= 17

using __standard_header_cstdbool _LIBCPP_DEPRECATED _LIBCPP_NODEBUG = void;
using __use_standard_header_cstdbool _LIBCPP_NODEBUG = __standard_header_cstdbool;

# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
# warning <cstdbool> is deprecated in C++17 and removed in C++20.
# endif

#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

#endif // _LIBCPP_CSTDBOOL
13 changes: 2 additions & 11 deletions libcxx/include/ctgmath
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,8 @@
# pragma GCC system_header
# endif

# if _LIBCPP_STD_VER >= 20

using __standard_header_ctgmath
_LIBCPP_DEPRECATED_("removed in C++20. Include <cmath> and <complex> instead.") _LIBCPP_NODEBUG = void;
using __use_standard_header_ctgmath _LIBCPP_NODEBUG = __standard_header_ctgmath;

# elif _LIBCPP_STD_VER >= 17

using __standard_header_ctgmath _LIBCPP_DEPRECATED_("Include <cmath> and <complex> instead.") _LIBCPP_NODEBUG = void;
using __use_standard_header_ctgmath _LIBCPP_NODEBUG = __standard_header_ctgmath;

# if _LIBCPP_STD_VER >= 17 && !__building_module(std) && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
# warning <ctgmath> is deprecated in C++17 and removed in C++20. Include <cmath> and <complex> instead.
# endif

#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/libcxx/transitive_includes.gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
// RUN: mkdir %t
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
// RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -Wno-deprecated --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes/to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
// RUN: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
// RUN: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv
Expand Down
8 changes: 1 addition & 7 deletions libcxx/test/std/depr/depr.cpp.headers/ccomplex.verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-modules-build

#include "test_macros.h"

#include <ccomplex>

#if TEST_STD_VER >= 20
// expected-warning@ccomplex:* {{'__standard_header_ccomplex' is deprecated: removed in C++20. Include <complex> instead.}}
#else
// expected-warning@ccomplex:* {{'__standard_header_ccomplex' is deprecated: Include <complex> instead.}}
#endif
// expected-warning@ccomplex:* {{<ccomplex> is deprecated in C++17 and removed in C++20. Include <complex> instead.}}
3 changes: 2 additions & 1 deletion libcxx/test/std/depr/depr.cpp.headers/ciso646.verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
// UNSUPPORTED: clang-modules-build

#include <ciso646>
// expected-warning@ciso646:* {{'__standard_header_ciso646' is deprecated: removed in C++20. Include <version> instead.}}

// expected-warning@ciso646:* {{<ciso646> is removed in C++20. Include <version> instead.}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-modules-build

#include "test_macros.h"

#include <cstdalign>

#if TEST_STD_VER >= 20
// expected-warning@cstdalign:* {{'__standard_header_cstdalign' is deprecated: removed in C++20.}}
#else
// expected-warning@cstdalign:* {{'__standard_header_cstdalign' is deprecated}}
#endif
// expected-warning@cstdalign:* {{<cstdalign> is deprecated in C++17 and removed in C++20.}}
8 changes: 1 addition & 7 deletions libcxx/test/std/depr/depr.cpp.headers/cstdbool.verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-modules-build

#include "test_macros.h"

#include <cstdbool>

#if TEST_STD_VER >= 20
// expected-warning@cstdbool:* {{'__standard_header_cstdbool' is deprecated: removed in C++20.}}
#else
// expected-warning@cstdbool:* {{'__standard_header_cstdbool' is deprecated}}
#endif
// expected-warning@cstdbool:* {{<cstdbool> is deprecated in C++17 and removed in C++20.}}
8 changes: 1 addition & 7 deletions libcxx/test/std/depr/depr.cpp.headers/ctgmath.verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-modules-build

#include "test_macros.h"

#include <ctgmath>

#if TEST_STD_VER >= 20
// expected-warning@ctgmath:* {{'__standard_header_ctgmath' is deprecated: removed in C++20. Include <cmath> and <complex> instead.}}
#else
// expected-warning@ctgmath:* {{'__standard_header_ctgmath' is deprecated: Include <cmath> and <complex> instead.}}
#endif
// expected-warning@ctgmath:* {{<ctgmath> is deprecated in C++17 and removed in C++20. Include <cmath> and <complex> instead.}}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: std-at-least-c++23
// REQUIRES: std-at-least-c++26

// <tuple>

Expand All @@ -21,11 +21,6 @@
void test() {
// expected-error@*:* {{static assertion failed}}

// Turns to an error since C++26 (Disallow Binding a Returned Glvalue to a Temporary https://wg21.link/P2748R5).
#if TEST_STD_VER >= 26
// expected-error@tuple:* {{returning reference to local temporary object}}
#else
// expected-warning@tuple:* {{returning reference to local temporary object}}
#endif
std::ignore = std::make_from_tuple<const int&>(std::tuple<char>{});
}
2 changes: 1 addition & 1 deletion libcxx/utils/libcxx/test/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def parseScript(test, preamble):
substitutions.append(
(
"%{verify}",
"%{cxx} %s %{flags} %{compile_flags} -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0",
"%{cxx} %s %{flags} %{compile_flags} -U_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -fsyntax-only -Wno-error -Xclang -verify -Xclang -verify-ignore-unexpected=note -ferror-limit=0",
)
)
substitutions.append(("%{run}", "%{exec} %t.exe"))
Expand Down
Loading