Skip to content

Commit

Permalink
Merge pull request #5089 from afeher/add-abi-compatibility-flags-drqs…
Browse files Browse the repository at this point in the history
…-172377144

Introducing forced ABI levels.
  • Loading branch information
cppguru authored and GitHub Enterprise committed Jan 27, 2025
2 parents 601357d + 955e006 commit 184e5ee
Show file tree
Hide file tree
Showing 24 changed files with 538 additions and 281 deletions.
48 changes: 24 additions & 24 deletions groups/bdl/bdlb/bdlb_nullablevalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ bool operator==(const bsl::optional<LHS_TYPE>& lhs,
}
#endif
;
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
bool operator==(const NullableValue<LHS_TYPE>& lhs,
const std::optional<RHS_TYPE>& rhs)
Expand All @@ -694,7 +694,7 @@ bool operator==(const std::optional<LHS_TYPE>& lhs,
}
#endif
;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

/// Return `true` if the specified `lhs` and `rhs` nullable objects do not
/// have the same value, and `false` otherwise. Two nullable objects do not
Expand Down Expand Up @@ -729,7 +729,7 @@ bool operator!=(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
bool operator!=(const std::optional<LHS_TYPE>& lhs,
const NullableValue<RHS_TYPE>& rhs)
Expand All @@ -748,7 +748,7 @@ bool operator!=(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

/// Return `true` if the specified `lhs` and `rhs` objects do not have the
/// same value, and `false` otherwise. A nullable object and a value of
Expand Down Expand Up @@ -830,7 +830,7 @@ bool operator<(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
bool operator<(const std::optional<LHS_TYPE>& lhs,
const NullableValue<RHS_TYPE>& rhs)
Expand All @@ -849,7 +849,7 @@ bool operator<(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

/// Return `true` if the specified `lhs` nullable object is ordered before
/// the specified `rhs`, and `false` otherwise. `lhs` is ordered before
Expand Down Expand Up @@ -909,7 +909,7 @@ bool operator>(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
bool operator>(const std::optional<LHS_TYPE>& lhs,
const NullableValue<RHS_TYPE>& rhs)
Expand All @@ -928,7 +928,7 @@ bool operator>(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

/// Return `true` if the specified `lhs` nullable object is ordered after
/// the specified `rhs`, and `false` otherwise. `lhs` is ordered after
Expand Down Expand Up @@ -987,7 +987,7 @@ bool operator<=(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
bool operator<=(const std::optional<LHS_TYPE>& lhs,
const NullableValue<RHS_TYPE>& rhs)
Expand All @@ -1006,7 +1006,7 @@ bool operator<=(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

/// Return `true` if the specified `lhs` nullable object is ordered before
/// the specified `rhs` or `lhs` and `rhs` have the same value, and `false`
Expand Down Expand Up @@ -1065,7 +1065,7 @@ bool operator>=(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
bool operator>=(const std::optional<LHS_TYPE>& lhs,
const NullableValue<RHS_TYPE>& rhs)
Expand All @@ -1084,7 +1084,7 @@ bool operator>=(const NullableValue<LHS_TYPE>& lhs,
}
#endif
;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

/// Return `true` if the specified `lhs` nullable object is ordered after
/// the specified `rhs` or `lhs` and `rhs` have the same value, and `false`
Expand Down Expand Up @@ -1864,7 +1864,7 @@ bool bdlb::operator==(const bsl::optional<LHS_TYPE>& lhs,
return lhs == static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
inline
bool bdlb::operator==(const NullableValue<LHS_TYPE>& lhs,
Expand All @@ -1890,7 +1890,7 @@ bool bdlb::operator==(const std::optional<LHS_TYPE>& lhs,
{
return lhs == static_cast<const bsl::optional<RHS_TYPE>&>(rhs);
}
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

template <class LHS_TYPE, class RHS_TYPE>
inline
Expand Down Expand Up @@ -1932,7 +1932,7 @@ bool bdlb::operator!=(const NullableValue<LHS_TYPE>& lhs,
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) != rhs;
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
inline
bool bdlb::operator!=(const std::optional<LHS_TYPE>& lhs,
Expand All @@ -1958,7 +1958,7 @@ bool bdlb::operator!=(const NullableValue<LHS_TYPE>& lhs,
{
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) != rhs;
}
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

template <class LHS_TYPE, class RHS_TYPE>
inline
Expand Down Expand Up @@ -2044,7 +2044,7 @@ bool bdlb::operator<(const NullableValue<LHS_TYPE>& lhs,
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) < rhs;
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
inline
bool bdlb::operator<(const std::optional<LHS_TYPE>& lhs,
Expand All @@ -2070,7 +2070,7 @@ bool bdlb::operator<(const NullableValue<LHS_TYPE>& lhs,
{
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) < rhs;
}
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

template <class LHS_TYPE, class RHS_TYPE>
inline
Expand Down Expand Up @@ -2134,7 +2134,7 @@ bool bdlb::operator>(const NullableValue<LHS_TYPE>& lhs,
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) > rhs;
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
inline
bool bdlb::operator>(const std::optional<LHS_TYPE>& lhs,
Expand All @@ -2160,7 +2160,7 @@ bool bdlb::operator>(const NullableValue<LHS_TYPE>& lhs,
{
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) > rhs;
}
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

template <class LHS_TYPE, class RHS_TYPE>
inline
Expand Down Expand Up @@ -2226,7 +2226,7 @@ bool bdlb::operator<=(const NullableValue<LHS_TYPE>& lhs,
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) <= rhs;
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
inline
bool bdlb::operator<=(const std::optional<LHS_TYPE>& lhs,
Expand All @@ -2252,7 +2252,7 @@ bool bdlb::operator<=(const NullableValue<LHS_TYPE>& lhs,
{
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) <= rhs;
}
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

template <class LHS_TYPE, class RHS_TYPE>
inline
Expand Down Expand Up @@ -2319,7 +2319,7 @@ bool bdlb::operator>=(const NullableValue<LHS_TYPE>& lhs,
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) >= rhs;
}

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
template <class LHS_TYPE, class RHS_TYPE>
inline
bool bdlb::operator>=(const std::optional<LHS_TYPE>& lhs,
Expand All @@ -2345,7 +2345,7 @@ bool bdlb::operator>=(const NullableValue<LHS_TYPE>& lhs,
{
return static_cast<const bsl::optional<LHS_TYPE>&>(lhs) >= rhs;
}
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

template <class LHS_TYPE, class RHS_TYPE>
inline
Expand Down
22 changes: 12 additions & 10 deletions groups/bdl/bdlb/bdlb_nullablevalue.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
# include <bsl_tuple.h>
#endif

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
# include <optional>
# include <string>
# include <variant>
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

using namespace BloombergLP;
using namespace bsl;
Expand Down Expand Up @@ -622,10 +622,10 @@ void testRelationalOperations(const INIT_TYPE& lesserVal,
typedef bsl::optional< FIRST_TYPE> FIRST_BO_TYPE;
typedef bsl::optional<SECOND_TYPE> SECOND_BO_TYPE;

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
typedef std::optional< FIRST_TYPE> FIRST_SO_TYPE;
typedef std::optional<SECOND_TYPE> SECOND_SO_TYPE;
#endif
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

testRelationalOperationsNonNull<FIRST_TYPE, SECOND_NV_TYPE>(lesserVal,
greaterVal);
Expand All @@ -648,7 +648,7 @@ void testRelationalOperations(const INIT_TYPE& lesserVal,
testRelationalOperationsBothNull<FIRST_NV_TYPE, SECOND_BO_TYPE>();
testRelationalOperationsBothNull<FIRST_BO_TYPE, SECOND_NV_TYPE>();

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES
testRelationalOperationsNonNull<FIRST_SO_TYPE, SECOND_NV_TYPE>(lesserVal,
greaterVal);
testRelationalOperationsNonNull<FIRST_NV_TYPE, SECOND_SO_TYPE>(lesserVal,
Expand All @@ -659,10 +659,11 @@ void testRelationalOperations(const INIT_TYPE& lesserVal,

testRelationalOperationsBothNull<FIRST_NV_TYPE, SECOND_SO_TYPE>();
testRelationalOperationsBothNull<FIRST_SO_TYPE, SECOND_NV_TYPE>();
#endif
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES

#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS && \
defined BSLSTL_OPTIONAL_USES_STD_ALIASES

ASSERTV((
bsl::three_way_comparable_with<FIRST_TYPE, SECOND_NV_TYPE> ==
Expand Down Expand Up @@ -6789,7 +6790,8 @@ struct Foo {
template <class t_TYPE>
void Foo::foo()
{
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) && \
defined(BSLSTL_OPTIONAL_USES_STD_ALIASES)
// Even more weirdly, the issue goes away if `NullableValue` is
// instantiated with `t_TYPE` instead of a fixed type.
bdlb::NullableValue<int> nv = 1;
Expand Down Expand Up @@ -7802,7 +7804,7 @@ int main(int argc, char *argv[])
<< "TEST `operator<<` FOR `std::optional` AND `std::variant`" << endl
<< "========================================================" << endl;

#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#ifdef BSLSTL_OPTIONAL_USES_STD_ALIASES

bsl::ostringstream oss;

Expand Down Expand Up @@ -7871,7 +7873,7 @@ int main(int argc, char *argv[])
#else
if (verbose) cout << "SKIP: Not Available: "
"`std::optional`, `std::variant`" << endl;
#endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
#endif // BSLSTL_OPTIONAL_USES_STD_ALIASES
} break;
case 32: {
// --------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 184e5ee

Please sign in to comment.