[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread lukaszcz18 at wp dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

--- Comment #8 from Jamaika  ---
Thanks for tips std::formatter
Something has improved. GCC notices that there isn't  for TIFFFormat.cpp

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

--- Comment #7 from Jonathan Wakely  ---
You still aren't showing the code that gives this error, so I'm just not going
to bother reading your big reports in future 

PNM_COLOUR_SPACE cannot be formatted because there is no
std::formatter specialization.

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread lukaszcz18 at wp dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

--- Comment #6 from Jamaika  ---
Thanks Jonathan

Thanks for the quick fix of the given errors. I realize that there may be other
errors not necessarily from gcc.


Test new codecs HTJPEG2000 C++20 Grok with spdlog 1.11.0 for Windows 10

In file included from
c:\gcc1300\x86_64-w64-mingw32\include\spdlog\fmt\fmt.h:14,
 from c:\gcc1300\x86_64-w64-mingw32\include\spdlog\common.h:50,
 from c:\gcc1300\x86_64-w64-mingw32\include\spdlog\spdlog.h:12,
 from common.h:40,
 from PNMFormat.cpp:29:
c:\gcc1300\include\c++\13.0.0\format: In instantiation of 'static
std::basic_format_args<_Context>::_Store<_Args>::_Element_t
std::basic_format_args<_Context>::_Store<_Args>::_S_make_elt(_Tp&) [with _Tp =
PNM_COLOUR_SPACE; _Args =
{std::basic_format_arg,
char> >::handle,
std::basic_format_arg,
char> >::handle}; _Context =
std::basic_format_context, char>; _Element_t =
std::basic_format_args,
char>
>::_Store,
char> >::handle,
std::basic_format_arg,
char> >::handle>::_Element_t]':
c:\gcc1300\include\c++\13.0.0\format:3248:25:   required from
'std::basic_format_args<_Context>::_Store<_Args>::_Store(_Tp& ...) [with _Tp =
{PNM_COLOUR_SPACE, PNM_COLOUR_SPACE}; _Args =
{std::basic_format_arg,
char> >::handle,
std::basic_format_arg,
char> >::handle}; _Context =
std::basic_format_context, char>]'
c:\gcc1300\include\c++\13.0.0\format:3300:14:   required from 'auto
std::make_format_args(_Args&& ...) [with _Context =
basic_format_context<__format::_Sink_iter, char>; _Args =
{PNM_COLOUR_SPACE&, PNM_COLOUR_SPACE&}]'
c:\gcc1300\x86_64-w64-mingw32\include\spdlog\logger.h:372:88:   required from
'void spdlog::logger::log_(spdlog::source_loc, spdlog::level::level_enum,
spdlog::string_view_t, Args&& ...) [with Args = {PNM_COLOUR_SPACE&,
PNM_COLOUR_SPACE&}; spdlog::string_view_t = std::basic_string_view]'
c:\gcc1300\x86_64-w64-mingw32\include\spdlog\logger.h:90:13:   required from
'void spdlog::logger::log(spdlog::source_loc, spdlog::level::level_enum,
spdlog::format_string_t, Args&& ...) [with Args = {PNM_COLOUR_SPACE&,
PNM_COLOUR_SPACE&}; spdlog::format_string_t =
std::basic_string_view]'
c:\gcc1300\x86_64-w64-mingw32\include\spdlog\logger.h:96:12:   required from
'void spdlog::logger::log(spdlog::level::level_enum,
spdlog::format_string_t, Args&& ...) [with Args = {PNM_COLOUR_SPACE&,
PNM_COLOUR_SPACE&}; spdlog::format_string_t =
std::basic_string_view]'
c:\gcc1300\x86_64-w64-mingw32\include\spdlog\logger.h:164:12:   required from
'void spdlog::logger::warn(spdlog::format_string_t, Args&& ...) [with
Args = {PNM_COLOUR_SPACE&, PNM_COLOUR_SPACE&}; spdlog::format_string_t = std::basic_string_view]'
c:\gcc1300\x86_64-w64-mingw32\include\spdlog\spdlog.h:167:31:   required from
'void spdlog::warn(format_string_t, Args&& ...) [with Args =
{PNM_COLOUR_SPACE&, PNM_COLOUR_SPACE&}; format_string_t =
std::basic_string_view]'
PNMFormat.cpp:600:16:   required from here
c:\gcc1300\include\c++\13.0.0\format:3237:40: error: no matching function for
call to
'std::basic_format_arg,
char> >::basic_format_arg(PNM_COLOUR_SPACE&)'
 3237 | basic_format_arg<_Context> __arg(__v);
  |^
c:\gcc1300\include\c++\13.0.0\format:3005:9: note: candidate: 'template  requires  __formattable_with<_Tp, _Context, typename
_Context::formatter_type::type>,
std::basic_format_parse_context >
std::basic_format_arg<_Context>::basic_format_arg(_Tp&) [with _Context =
std::basic_format_context, char>]'
 3005 | basic_format_arg(_Tp& __v) noexcept
  | ^~~~
c:\gcc1300\include\c++\13.0.0\format:3005:9: note:   template argument
deduction/substitution failed:
c:\gcc1300\include\c++\13.0.0\format:3005:9: note: constraints not satisfied
In file included from c:\gcc1300\include\c++\13.0.0\compare:37,
 from c:\gcc1300\include\c++\13.0.0\bits\char_traits.h:48,
 from c:\gcc1300\include\c++\13.0.0\string:42,
 from IImageFormat.h:21,
 from ImageFormat.h:20,
 from PNMFormat.h:19,
 from PNMFormat.cpp:26:
c:\gcc1300\include\c++\13.0.0\concepts: In substitution of 'template
 requires  __formattable_with<_Tp, _Context, typename
_Context::formatter_type::type>,
std::basic_format_parse_context >
std::basic_format_arg,
char> >::basic_format_arg(_Tp&) [with _Tp =
std::basic_format_context, char>]':
c:\gcc1300\include\c++\13.0.0\format:3237:33:   required from 'static
std::basic_format_args<_Context>::_Store<_Args>::_Element_t
std::basic_format_args<_Context>::_Store<_Args>::_S_make_elt(_Tp&) [with _Tp =
PNM_COLOUR_SPACE; _Args =
{std::basic_format_arg,
char> >::handle,
std::basic_format_arg,
char> >::handle}; _Context =
std::basic_format_context, char>; _Element_t =
std::basic_format_args,
char>
>::_Store,
char> >::handle,
std::basic_format_arg,
char> >::handle>::_Element_t]'

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |13.0
 Status|ASSIGNED|RESOLVED
   Keywords||rejects-valid

--- Comment #5 from Jonathan Wakely  ---
Fixed by r13-4613-gcb363fd9f19eb7

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

Jonathan Wakely  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Status|WAITING |ASSIGNED

--- Comment #4 from Jonathan Wakely  ---
(In reply to Jamaika from comment #0)
> c:\gcc1300\include\c++\13.0.0\format:3350:40: error: expected identifier
> before ',' token
>  3350 | __format::__do_vformat_to(_Out_, basic_string_view<_CharT_>,
>   |^

This looks like you've got _Out_ defined as a macro, which causes an error in
this friend declaration.

Then because the function isn't a friend, you get access errors in the function
that's supposed to be a friend:


> c:\gcc1300\include\c++\13.0.0\format: In instantiation of '_Out
> std::__format::__do_vformat_to(_Out, std::basic_string_view<_CharT>, const
> std::basic_format_args<_Context>&, const std::locale*) [with _Out =
> _Sink_iter; _CharT = char; _Context =
> std::basic_format_context<_Sink_iter, char>]':
> c:\gcc1300\include\c++\13.0.0\format:3646:39:   required from '_Out
> std::vformat_to(_Out, string_view, format_args) [with _Out =
> __format::_Sink_iter; string_view = basic_string_view;
> format_args =
> basic_format_args, char> >]'
> c:\gcc1300\include\c++\13.0.0\format:3673:20:   required from here
> c:\gcc1300\include\c++\13.0.0\format:3614:24: error:
> 'std::basic_format_context<_Out,
> _CharT>::basic_format_context(std::basic_format_args basic_format_context<_Out, _CharT> >, _Out) [with _Out =
> std::__format::_Sink_iter; _CharT = char]' is private within this
> context
>  3614 |  ? _Context(__args, __sink_out)
>   |^~~~
> c:\gcc1300\include\c++\13.0.0\format:3338:7: note: declared private here
>  3338 |   basic_format_context(basic_format_args
> __args,
>   |   ^~~~


And I think that's because _Out_ is a Windows SAL macro:

mingw-w64-tools/widl/include/sal.h:#define _Out_

So confirmed as a bug but next time please provide a proper bug report.

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

--- Comment #3 from Jonathan Wakely  ---
Why am I having to say this AGAIN?

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107886#c7
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107886#c9
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104592#c3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104592#c5

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed||2022-12-12
 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1

--- Comment #2 from Jonathan Wakely  ---
Not a valid bug report, please read https://gcc.gnu.org/bugs/

[Bug libstdc++/108062] Test spdlog c++20 std::format

2022-12-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108062

--- Comment #1 from Andrew Pinski  ---
I tried to test this but my cmake is not new enough:
  Target "example" requires the language dialect "CXX20" , but CMake does not