`<source_location>`: Remove EDG workaround for DevCom-10199227 (#4939)

Co-authored-by: Casey Carter <cacarter@microsoft.com>
This commit is contained in:
Igor Zhukov 2024-09-10 03:17:10 +07:00 коммит произвёл GitHub
Родитель 3da77ebd91
Коммит 0008e2f6de
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 71 добавлений и 22 удалений

Просмотреть файл

@ -21,11 +21,7 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
#ifndef _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__ // TRANSITION, DevCom-10199227
#define _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION 0
#else // ^^^ workaround / no workaround vvv
#define _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION 1
#endif // ^^^ no workaround ^^^
#endif // ^^^ !defined(_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION) ^^^
_STD_BEGIN

Просмотреть файл

@ -743,17 +743,11 @@ constexpr bool impl_test_source_location() {
assert(sl.line() == __LINE__ - 1);
assert(sl.column() == 38);
#ifdef __EDG__ // TRANSITION, DevCom-10199227
#define TEST_DETAILED_FUNCTION_NAME 0
#else // ^^^ workaround / no workaround vvv
#define TEST_DETAILED_FUNCTION_NAME 1
#endif // ^^^ no workaround ^^^
#if TEST_DETAILED_FUNCTION_NAME
#ifdef __EDG__
assert(sl.function_name() == "bool impl_test_source_location()"sv);
#else // ^^^ EDG / Other vvv
assert(sl.function_name() == "bool __cdecl impl_test_source_location(void)"sv);
#else // ^^^ detailed / basic vvv
assert(sl.function_name() == "impl_test_source_location"sv);
#endif // ^^^ basic ^^^
#endif // ^^^ Other ^^^
assert(string_view{sl.file_name()}.ends_with("test_header_units_and_modules.hpp"sv));
return true;

Просмотреть файл

@ -2,3 +2,6 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
RUNALL_INCLUDE ..\usual_20_matrix.lst
RUNALL_CROSSLIST
* PM_CL=""
* PM_CL="/D_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION=0"

Просмотреть файл

@ -18,7 +18,11 @@ constexpr void header_test() {
assert(x.column() == 37);
#endif // ^^^ C1XX ^^^
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__
assert(x.function_name() == "void header_test()"sv);
#else // ^^^ EDG / Other vvv
assert(x.function_name() == "void __cdecl header_test(void)"sv);
#endif // ^^^ Other ^^^
#else // ^^^ detailed / basic vvv
assert(x.function_name() == "header_test"sv);
#endif // ^^^ basic ^^^

Просмотреть файл

@ -68,7 +68,11 @@ constexpr void local_test() {
assert(x.column() == 37);
#endif // ^^^ C1XX ^^^
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__
assert(x.function_name() == "void local_test()"sv);
#else // ^^^ EDG / Other vvv
assert(x.function_name() == "void __cdecl local_test(void)"sv);
#endif // ^^^ Other ^^^
#else // ^^^ detailed / basic vvv
assert(x.function_name() == "local_test"sv);
#endif // ^^^ basic ^^^
@ -80,7 +84,11 @@ constexpr void argument_test(
assert(x.line() == line);
assert(x.column() == column);
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__
assert(x.function_name() == "bool test()"sv);
#else // ^^^ EDG / Other vvv
assert(x.function_name() == "bool __cdecl test(void)"sv);
#endif // ^^^ Other ^^^
#else // ^^^ detailed / basic vvv
assert(x.function_name() == "test"sv);
#endif // ^^^ basic ^^^
@ -102,10 +110,21 @@ constexpr void sloc_constructor_test() {
} else
#endif // ^^^ workaround ^^^
{
#ifdef __EDG__
assert(x.loc.function_name() == "void sloc_constructor_test()"sv);
#else // ^^^ EDG / Other vvv
assert(x.loc.function_name() == "void __cdecl sloc_constructor_test(void)"sv);
#endif // ^^^ Other ^^^
}
#else // ^^^ detailed / basic vvv
assert(x.loc.function_name() == "sloc_constructor_test"sv);
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783
if (is_constant_evaluated()) {
assert(x.loc.function_name() == "main"sv);
} else
#endif // ^^^ workaround ^^^
{
assert(x.loc.function_name() == "sloc_constructor_test"sv);
}
#endif // ^^^ basic ^^^
assert(string_view{x.loc.file_name()}.ends_with(test_cpp));
}
@ -121,7 +140,11 @@ constexpr void different_constructor_test() {
assert(x.loc.column() == 5);
#endif // ^^^ C1XX ^^^
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__
assert(x.loc.function_name() == "s::s(int)"sv);
#else // ^^^ EDG / Other vvv
assert(x.loc.function_name() == THISCALL_OR_CDECL " s::s(int)"sv);
#endif // ^^^ Other ^^^
#else // ^^^ detailed / basic vvv
assert(x.loc.function_name() == "s"sv);
#endif // ^^^ basic ^^^
@ -143,10 +166,21 @@ constexpr void sub_member_test() {
} else
#endif // ^^^ workaround ^^^
{
#ifdef __EDG__
assert(s.x.loc.function_name() == "void sub_member_test()"sv);
#else // ^^^ EDG / Other vvv
assert(s.x.loc.function_name() == "void __cdecl sub_member_test(void)"sv);
#endif // ^^^ Other ^^^
}
#else // ^^^ detailed / basic vvv
assert(s.x.loc.function_name() == "sub_member_test"sv);
#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1285783
if (is_constant_evaluated()) {
assert(s.x.loc.function_name() == "main"sv);
} else
#endif // ^^^ workaround ^^^
{
assert(s.x.loc.function_name() == "sub_member_test"sv);
}
#endif // ^^^ basic ^^^
assert(string_view{s.x.loc.file_name()}.ends_with(test_cpp));
@ -160,7 +194,11 @@ constexpr void sub_member_test() {
assert(s_i.x.loc.column() == 5);
#endif // ^^^ C1XX ^^^
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__
assert(s_i.x.loc.function_name() == "s2::s2(int)"sv);
#else // ^^^ EDG / Other vvv
assert(s_i.x.loc.function_name() == THISCALL_OR_CDECL " s2::s2(int)"sv);
#endif // ^^^ Other ^^^
#else // ^^^ detailed / basic vvv
assert(s_i.x.loc.function_name() == "s2"sv);
#endif // ^^^ basic ^^^
@ -185,19 +223,29 @@ constexpr void lambda_test() {
assert(x2.column() == 50);
#endif // ^^^ C1XX ^^^
#if _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#ifdef __EDG__
assert(x1.function_name() == "void lambda_test()"sv);
#else // ^^^ EDG / Other vvv
assert(x1.function_name() == "void __cdecl lambda_test(void)"sv);
#endif // ^^^ Other ^^^
#else // ^^^ detailed / basic vvv
assert(x1.function_name() == "lambda_test"sv);
#endif // ^^^ basic ^^^
const string_view fun2{x2.function_name()};
#if !_USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION
#if !defined(__clang__) && !defined(__EDG__)
assert(fun2 == "operator ()"sv);
#else // ^^^ C1XX / Other vvv
assert(fun2 == "operator()"sv);
#endif // ^^^ Other ^^^
#elif defined(__clang__) // ^^^ basic / detailed Clang vvv
assert(fun2 == "auto " THISCALL_OR_CDECL " lambda_test()::(anonymous class)::operator()(void) const"sv);
#else // ^^^ detailed Clang / detailed non-Clang vvv
#elif defined(__EDG__) // ^^^ detailed Clang / detailed __EDG__ vvv
assert(fun2 == "lambda []()->auto::operator()()->auto"sv);
#else // ^^^ detailed __EDG__ / detailed C1XX vvv
assert(fun2.starts_with("struct std::source_location " THISCALL_OR_CDECL " lambda_test::<lambda_"sv));
assert(fun2.ends_with("::operator ()(void) const"sv));
#endif // ^^^ detailed non-Clang ^^^
#endif // ^^^ detailed C1XX ^^^
assert(string_view{x1.file_name()}.ends_with(test_cpp));
assert(string_view{x2.file_name()}.ends_with(test_cpp));
}
@ -221,9 +269,11 @@ constexpr void function_template_test() {
assert(x1.function_name() == "function_template"sv);
#elif defined(__clang__) // ^^^ basic / detailed Clang vvv
assert(x1.function_name() == "source_location __cdecl function_template(void) [T = void]"sv);
#else // ^^^ detailed Clang / detailed non-Clang vvv
#elif defined(__EDG__) // ^^^ detailed Clang / detailed __EDG__ vvv
assert(x1.function_name() == "std::source_location function_template<void>()"sv);
#else // ^^^ detailed __EDG__ / detailed C1XX vvv
assert(x1.function_name() == "struct std::source_location __cdecl function_template<void>(void)"sv);
#endif // ^^^ detailed non-Clang ^^^
#endif // ^^^ detailed C1XX ^^^
assert(string_view{x1.file_name()}.ends_with(test_cpp));
const auto x2 = function_template<int>();
@ -233,9 +283,11 @@ constexpr void function_template_test() {
assert(x2.function_name() == "function_template"sv);
#elif defined(__clang__) // ^^^ basic / detailed Clang vvv
assert(x2.function_name() == "source_location __cdecl function_template(void) [T = int]"sv);
#else // ^^^ detailed Clang / detailed non-Clang vvv
#elif defined(__EDG__) // ^^^ detailed Clang / detailed __EDG__ vvv
assert(x2.function_name() == "std::source_location function_template<int>()"sv);
#else // ^^^ detailed __EDG__ / detailed C1XX vvv
assert(x2.function_name() == "struct std::source_location __cdecl function_template<int>(void)"sv);
#endif // ^^^ detailed non-Clang ^^^
#endif // ^^^ detailed C1XX ^^^
assert(string_view{x1.file_name()} == string_view{x2.file_name()});
}