[libc++][C++03] Fix ODR tests (#169349)

We don't really need to include `<__config>`. We just need to include a
public C++ header.
This commit is contained in:
Nikolas Klauser
2025-11-25 12:49:59 +01:00
committed by GitHub
parent 51dd3ec13c
commit 68c2a8140f
2 changed files with 6 additions and 10 deletions

View File

@@ -9,8 +9,6 @@
// ABI tags have no effect in MSVC mode.
// XFAIL: msvc
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
// Test that we encode whether exceptions are supported in an ABI tag to avoid
// ODR violations when linking TUs that have different values for it.
@@ -24,14 +22,14 @@
// -fno-exceptions
#ifdef TU1
# include <__config>
# include <version>
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 1; }
int tu1() { return f(); }
#endif // TU1
// -fexceptions
#ifdef TU2
# include <__config>
# include <version>
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 2; }
int tu2() { return f(); }
#endif // TU2

View File

@@ -9,8 +9,6 @@
// ABI tags have no effect in MSVC mode.
// XFAIL: msvc
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
// Test that we encode the hardening mode in an ABI tag to avoid ODR violations
// when linking TUs that have different values for it.
@@ -27,28 +25,28 @@
// fast hardening mode
#ifdef TU1
# include <__config>
# include <version>
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 1; }
int tu1() { return f(); }
#endif // TU1
// extensive hardening mode
#ifdef TU2
# include <__config>
# include <version>
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 2; }
int tu2() { return f(); }
#endif // TU2
// debug hardening mode
#ifdef TU3
# include <__config>
# include <version>
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 3; }
int tu3() { return f(); }
#endif // TU3
// No hardening
#ifdef TU4
# include <__config>
# include <version>
_LIBCPP_HIDE_FROM_ABI TEST_NOINLINE inline int f() { return 4; }
int tu4() { return f(); }
#endif // TU4