Skip to content

Commit cbe2ee9

Browse files
Update tests for upcoming compiler changes to consteval (#5960)
1 parent 7c0b1c4 commit cbe2ee9

File tree

2 files changed

+12
-15
lines changed
  • tests/std/tests

2 files changed

+12
-15
lines changed

tests/std/tests/P1208R6_source_location/test.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,15 @@ constexpr void sloc_constructor_test() {
9696
assert(x.loc.column() == 13);
9797
#endif // ^^^ !defined(__EDG__) ^^^
9898
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
99-
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783
100-
if (is_constant_evaluated()) {
101-
assert(x.loc.function_name() == "int __cdecl main(void)"sv);
102-
} else
99+
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783 (fixed in MSVC Compiler 19.51)
100+
if (!is_constant_evaluated())
103101
#endif // ^^^ workaround ^^^
104102
{
105103
assert(x.loc.function_name() == "void __cdecl sloc_constructor_test(void)"sv);
106104
}
107105
#else // ^^^ detailed / basic vvv
108-
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783
109-
if (is_constant_evaluated()) {
110-
assert(x.loc.function_name() == "main"sv);
111-
} else
106+
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783 (fixed in MSVC Compiler 19.51)
107+
if (!is_constant_evaluated())
112108
#endif // ^^^ workaround ^^^
113109
{
114110
assert(x.loc.function_name() == "sloc_constructor_test"sv);
@@ -146,19 +142,15 @@ constexpr void sub_member_test() {
146142
assert(s.x.loc.column() == 14);
147143
#endif // ^^^ !defined(__EDG__) ^^^
148144
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
149-
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783
150-
if (is_constant_evaluated()) {
151-
assert(s.x.loc.function_name() == "int __cdecl main(void)"sv);
152-
} else
145+
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783 (fixed in MSVC Compiler 19.51)
146+
if (!is_constant_evaluated())
153147
#endif // ^^^ workaround ^^^
154148
{
155149
assert(s.x.loc.function_name() == "void __cdecl sub_member_test(void)"sv);
156150
}
157151
#else // ^^^ detailed / basic vvv
158152
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783
159-
if (is_constant_evaluated()) {
160-
assert(s.x.loc.function_name() == "main"sv);
161-
} else
153+
if (!is_constant_evaluated())
162154
#endif // ^^^ workaround ^^^
163155
{
164156
assert(s.x.loc.function_name() == "sub_member_test"sv);

tests/std/tests/VSO_1775715_user_defined_modules/user.ixx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ namespace user {
1616
assert(test_environment_preparer.succeeded());
1717
}
1818

19+
// TRANSITION, VSO-2649620 reachability problem in modules
20+
// The compiler does not export the bindings for `operator==` for a string
21+
// and character pointer unless we force it with this export.
22+
export using std::operator==;
23+
1924
// DevCom-10313766 VSO-1775715 "Using std::format in a module
2025
// requires including <format> header in .cpp files using that module"
2126
export template <class T>

0 commit comments

Comments
 (0)