Skip to content

Commit 4e0715f

Browse files
authored
Merge pull request #6996 from GitMasterJatin/removing-HPX_WITH_CXX20_SOURCE_LOCATION
cmake: remove HPX_WITH_CXX20_SOURCE_LOCATION feature test
2 parents afc724d + af62a4b commit 4e0715f

6 files changed

Lines changed: 1 addition & 99 deletions

File tree

cmake/HPX_AddConfigTest.cmake

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,15 +498,6 @@ function(hpx_check_for_cxx20_lambda_capture)
498498
)
499499
endfunction()
500500

501-
# ##############################################################################
502-
function(hpx_check_for_cxx20_source_location)
503-
add_hpx_config_test(
504-
HPX_WITH_CXX20_SOURCE_LOCATION
505-
SOURCE cmake/tests/cxx20_source_location.cpp
506-
FILE ${ARGN}
507-
)
508-
endfunction()
509-
510501
# ##############################################################################
511502
function(hpx_check_for_pthread_setname_np)
512503
add_hpx_config_test(

cmake/HPX_PerformCxxFeatureTests.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ function(hpx_perform_cxx_feature_tests)
9898
DEFINITIONS HPX_HAVE_CXX20_LAMBDA_CAPTURE
9999
)
100100

101-
hpx_check_for_cxx20_source_location(
102-
DEFINITIONS HPX_HAVE_CXX20_SOURCE_LOCATION
103-
)
104-
105101
if(HPX_WITH_SUPPORT_NO_UNIQUE_ADDRESS_ATTRIBUTE AND NOT MSVC) # see above
106102
hpx_check_for_cxx20_no_unique_address_attribute(
107103
DEFINITIONS HPX_HAVE_CXX20_NO_UNIQUE_ADDRESS_ATTRIBUTE

cmake/templates/std_headers.hpp.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545
#endif
4646

4747
#include <bit>
48-
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
49-
# include <source_location>
50-
#endif
48+
#include <source_location>
5149

5250
#if defined(HPX_HAVE_CXX23_STD_GENERATOR)
5351
# include <generator>

cmake/tests/cxx20_source_location.cpp

Lines changed: 0 additions & 19 deletions
This file was deleted.

libs/core/assertion/include/hpx/assertion/macros.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,5 @@
9999
"on the issue tracker: https://github.com/STEllAR-GROUP/hpx/issues."); \
100100
std::terminate()
101101

102-
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
103102
#define HPX_CURRENT_SOURCE_LOCATION() std::source_location::current()
104-
#else
105-
#define HPX_CURRENT_SOURCE_LOCATION() \
106-
::hpx::source_location \
107-
{ \
108-
__FILE__, static_cast<std::uint_least32_t>(__LINE__), __func__ \
109-
}
110-
#endif
111103
#endif

libs/core/assertion/include/hpx/assertion/source_location.hpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,70 +13,14 @@
1313

1414
#include <hpx/config/export_definitions.hpp>
1515

16-
#include <cstdint>
1716
#include <iosfwd>
18-
19-
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
2017
#include <source_location>
21-
#endif
2218

2319
namespace hpx {
2420

2521
/// This contains the location information where \a HPX_ASSERT has been
2622
/// called
27-
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
2823
HPX_CXX_CORE_EXPORT using std::source_location;
29-
#else
30-
/// The \a source_location class represents certain information about the
31-
/// source code, such as file names, line numbers, and function names.
32-
/// Previously, functions that desire to obtain this information about
33-
/// the call site (for logging, testing, or debugging purposes) must
34-
/// use macros so that predefined macros like \a __LINE__ and \a __FILE__
35-
/// are expanded in the context of the caller. The \a source_location class
36-
/// provides a better alternative.
37-
/// \a source_location meets the \a DefaultConstructible, \a CopyConstructible,
38-
/// \a CopyAssignable and \a Destructible requirements. Lvalue of \a
39-
/// source_location meets the Swappable requirement. Additionally, the following
40-
/// conditions are true:
41-
/// - \code std::is_nothrow_move_constructible_v<std::source_location> \endcode
42-
/// - \code std::is_nothrow_move_assignable_v<std::source_location> \endcode
43-
/// - \code std::is_nothrow_swappable_v<std::source_location> \endcode
44-
/// It is intended that source_location has a small size and can be copied
45-
/// efficiently.
46-
/// It is unspecified whether the copy/move constructors and the copy/move
47-
/// assignment operators of \a source_location are trivial and/or constexpr.
48-
HPX_CXX_CORE_EXPORT struct source_location
49-
{
50-
char const* filename;
51-
std::uint_least32_t line_number;
52-
char const* functionname;
53-
54-
// compatibility with C++20 std::source_location
55-
/// return the line number represented by this object
56-
[[nodiscard]] constexpr std::uint_least32_t line() const noexcept
57-
{
58-
return line_number;
59-
}
60-
61-
/// return the column number represented by this object
62-
[[nodiscard]] static constexpr std::uint_least32_t column() noexcept
63-
{
64-
return 0;
65-
}
66-
67-
/// return the file name represented by this object
68-
[[nodiscard]] constexpr char const* file_name() const noexcept
69-
{
70-
return filename;
71-
}
72-
73-
/// return the name of the function represented by this object, if any
74-
[[nodiscard]] constexpr char const* function_name() const noexcept
75-
{
76-
return functionname;
77-
}
78-
};
79-
#endif
8024

8125
HPX_CXX_CORE_EXPORT HPX_CORE_EXPORT std::ostream& operator<<(
8226
std::ostream& os, source_location const& loc);

0 commit comments

Comments
 (0)