Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails on Windows 11 #14

Open
k-Knight opened this issue Apr 23, 2023 · 2 comments
Open

Compilation fails on Windows 11 #14

k-Knight opened this issue Apr 23, 2023 · 2 comments

Comments

@k-Knight
Copy link

C:\Users\k-Knight\Git\clang-unformat\standalone\cli_config.cpp:147:19:   required from here
C:/Users/k-Knight/Git/clang-unformat/build/_deps/fmt-src/include/fmt/core.h:1451:54: error: 'constexpr bool fmt::v8::detail::has_const_formatter() [with T = std::filesystem::__cxx11::path; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>]' called in a constant expression before its definition is complete
 1451 |       : bool_constant<has_const_formatter<U, Context>() ||
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
C:/Users/k-Knight/Git/clang-unformat/build/_deps/fmt-src/include/fmt/core.h:1452:68: note: in template argument for type 'bool'
 1451 |       : bool_constant<has_const_formatter<U, Context>() ||
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1452 |                       !std::is_const<remove_reference_t<T>>::value ||
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
 1453 |                       has_fallback_formatter<U, char_type>::value> {};
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mingw32-make[3]: *** [CMakeFiles\clang-unformat.dir\build.make:106: CMakeFiles/clang-unformat.dir/standalone/cli_config.cpp.obj] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:1216: CMakeFiles/clang-unformat.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:1223: CMakeFiles/clang-unformat.dir/rule] Error 2
mingw32-make: *** [Makefile:168: clang-unformat] Error 2
@gfgit
Copy link

gfgit commented Jun 25, 2023

Same issue:

clang-unformat\standalone\cli_config.cpp:147: error: 'constexpr bool fmt::v8::detail::has_const_formatter() [with T = std::filesystem::__cxx11::path; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>]' called in a constant expression before its definition is complete
clang-unformat/build/_deps/fmt-src/include/fmt/core.h:1855:71:   required from 'constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {std::filesystem::__cxx11::path&}; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {std::filesystem::__cxx11::path}]'
clang-unformat/build/_deps/fmt-src/include/fmt/core.h:1872:38:   required from 'constexpr fmt::v8::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<Args>::type>::type ...> fmt::v8::make_format_args(Args&& ...) [with Context = basic_format_context<appender, char>; Args = {std::filesystem::__cxx11::path&}]'
clang-unformat/build/_deps/fmt-src/include/fmt/core.h:3207:44:   required from 'void fmt::v8::print(format_string<T ...>, T&& ...) [with T = {std::filesystem::__cxx11::path&}; format_string<T ...> = basic_format_string<char, std::filesystem::__cxx11::path&>]'
clang-unformat/standalone/cli_config.cpp:147:19:   required from here
clang-unformat/build/_deps/fmt-src/include/fmt/core.h:1451:54: error: 'constexpr bool fmt::v8::detail::has_const_formatter() [with T = std::filesystem::__cxx11::path; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>]' called in a constant expression before its definition is complete
 1451 |       : bool_constant<has_const_formatter<U, Context>() ||
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
clang-unformat/build/_deps/fmt-src/include/fmt/core.h:1452:68: note: in template argument for type 'bool'
 1451 |       : bool_constant<has_const_formatter<U, Context>() ||
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1452 |                       !std::is_const<remove_reference_t<T>>::value ||
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
 1453 |                       has_fallback_formatter<U, char_type>::value> {};
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OS: Windows 10 64-bit
Compiler: MinGW-W64 12.2.0

Is this library fault or clang-unformat error?

@gfgit
Copy link

gfgit commented Jun 25, 2023

@k-Knight If you need it working soon, I've made a temp fix.
0001-Temp-fix-make-it-compile-on-Windows-10.patch
0002-Fix-linking-with-MinGW-W64-12.2.0.patch

The second one is only needed if you compile with MinGW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants