[flang-commits] [lldb] [openmp] [lld] [compiler-rt] [clang-tools-extra] [llvm] [clang] [libcxx] [mlir] [libc] [flang] [libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (PR #76449)

Petr Hosek via flang-commits flang-commits at lists.llvm.org
Sun Jan 21 19:15:52 PST 2024


petrhosek wrote:

The `llvm-libc++-static-clangcl.cfg.in :: std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp` is failing on Windows with the following error:
```
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
C:/b/s/w/ir/x/w/llvm_build/./bin/clang-cl.exe C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp --driver-mode=g++ --target=x86_64-pc-windows-msvc -fms-runtime-lib=static -nostdinc++ -I C:/b/s/w/ir/x/w/llvm_build/include/c++/v1 -I C:/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -I C:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings  -llibc++experimental -nostdlib -L C:/b/s/w/ir/x/w/llvm_build/./lib/x86_64-pc-windows-msvc -llibc++ -llibcpmt -o C:\b\s\w\ir\x\w\llvm_build\runtimes\runtimes-x86_64-pc-windows-msvc-bins\test\std\utilities\format\format.arguments\format.arg\Output\visit.return_type.pass.cpp.dir\t.tmp.exe
# executed command: C:/b/s/w/ir/x/w/llvm_build/./bin/clang-cl.exe 'C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp' --driver-mode=g++ --target=x86_64-pc-windows-msvc -fms-runtime-lib=static -nostdinc++ -I C:/b/s/w/ir/x/w/llvm_build/include/c++/v1 -I C:/b/s/w/ir/x/w/llvm_build/include/x86_64-pc-windows-msvc/c++/v1 -I C:/b/s/w/ir/x/w/llvm-llvm-project/libcxx/test/support -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_STDIO_ISO_WIDE_SPECIFIERS -DNOMINMAX -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -llibc++experimental -nostdlib -L C:/b/s/w/ir/x/w/llvm_build/./lib/x86_64-pc-windows-msvc -llibc++ -llibcpmt -o 'C:\b\s\w\ir\x\w\llvm_build\runtimes\runtimes-x86_64-pc-windows-msvc-bins\test\std\utilities\format\format.arguments\format.arg\Output\visit.return_type.pass.cpp.dir\t.tmp.exe'
# .---command stderr------------
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:134:35: error: implicit conversion from 'long long' to 'const long' changes value from 192812079084 to -461449236 [-Werror,-Wconstant-conversion]
# |   134 |   test<Context, bool, long>(true, 192812079084L);
# |       |   ~~~~                            ^~~~~~~~~~~~~
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:363:3: note: in instantiation of function template specialization 'test<char>' requested here
# |   363 |   test<char>();
# |       |   ^
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:135:36: error: implicit conversion from 'long long' to 'const long' changes value from 192812079084 to -461449236 [-Werror,-Wconstant-conversion]
# |   135 |   test<Context, bool, long>(false, 192812079084L);
# |       |   ~~~~                             ^~~~~~~~~~~~~
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:40:12: error: implicit conversion from 'long long' to 'long' changes value from 192812079084 to -461449236 [-Werror,-Wconstant-conversion]
# |    40 |     return 192812079084L;
# |       |     ~~~~~~ ^~~~~~~~~~~~~
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:60:20: note: in instantiation of function template specialization 'make_expected_result<long>' requested here
# |    60 |             return make_expected_result<ExpectedR>();
# |       |                    ^
# | C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__type_traits/invoke.h:344:25: note: in instantiation of function template specialization 'test(bool, const long &)::(anonymous class)::operator()<bool>' requested here
# |   344 |                { return static_cast<_Fp&&>(__f)(static_cast<_Args&&>(__args)...); }
# |       |                         ^
# | C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__functional/invoke.h:28:15: note: in instantiation of function template specialization 'std::__invoke<(lambda at C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:57:54), bool &>' requested here
# |    28 |   return std::__invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
# |       |               ^
# | C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__functional/invoke.h:47:17: note: in instantiation of function template specialization 'std::invoke<(lambda at C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:57:54), bool &>' requested here
# |    47 |     return std::invoke(std::forward<_Fn>(__f), std::forward<_Args>(__args)...);
# |       |                 ^
# | C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__format/format_arg.h:155:17: note: in instantiation of function template specialization 'std::invoke_r<long, (lambda at C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:57:54), bool &>' requested here
# |   155 |     return std::invoke_r<_Rp>(std::forward<_Visitor>(__vis), __arg.__value_.__boolean_);
# |       |                 ^
# | C:/b/s/w/ir/x/w/llvm_build/include/c++/v1\__format/format_arg.h:323:19: note: in instantiation of function template specialization 'std::__visit_format_arg<long, (lambda at C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:57:54), std::basic_format_context<char *, char>>' requested here
# |   323 |       return std::__visit_format_arg<_Rp>(std::forward<_Visitor>(__vis), __arg);
# |       |                   ^
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:57:37: note: in instantiation of function template specialization 'std::basic_format_arg<std::basic_format_context<char *, char>>::visit<long, (lambda at C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:57:54)>' requested here
# |    57 |         format_args.get(0).template visit<ExpectedR>([v = To(value)](auto a) -> ExpectedR {
# |       |                                     ^
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:134:3: note: in instantiation of function template specialization 'test<std::basic_format_context<char *, char>, bool, long, bool>' requested here
# |   134 |   test<Context, bool, long>(true, 192812079084L);
# |       |   ^
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:363:3: note: in instantiation of function template specialization 'test<char>' requested here
# |   363 |   test<char>();
# |       |   ^
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:134:35: error: implicit conversion from 'long long' to 'const long' changes value from 192812079084 to -461449236 [-Werror,-Wconstant-conversion]
# |   134 |   test<Context, bool, long>(true, 192812079084L);
# |       |   ~~~~                            ^~~~~~~~~~~~~
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:365:3: note: in instantiation of function template specialization 'test<wchar_t>' requested here
# |   365 |   test<wchar_t>();
# |       |   ^
# | C:\b\s\w\ir\x\w\llvm-llvm-project\libcxx\test\std\utilities\format\format.arguments\format.arg\visit.return_type.pass.cpp:135:36: error: implicit conversion from 'long long' to 'const long' changes value from 192812079084 to -461449236 [-Werror,-Wconstant-conversion]
# |   135 |   test<Context, bool, long>(false, 192812079084L);
# |       |   ~~~~                             ^~~~~~~~~~~~~
# | 5 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--
```
Would it be possible to take a look and revert the change if you cannot do a quick fix forward?

https://github.com/llvm/llvm-project/pull/76449


More information about the flang-commits mailing list