public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/104990] New: [12 Regression] std::get_time is incompatible with clang 14
@ 2022-03-20 11:04 bero at lindev dot ch
  2022-03-20 12:41 ` [Bug libstdc++/104990] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bero at lindev dot ch @ 2022-03-20 11:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104990

            Bug ID: 104990
           Summary: [12 Regression] std::get_time is incompatible with
                    clang 14
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bero at lindev dot ch
  Target Milestone: ---

This sample code:


#include <iomanip>
#include <iostream>

int main(int argc, char **argv) {
        std::tm tm = {};
        std::stringstream ss("2022-03-18 01:02:03");
        ss >>std::get_time(&tm, "%Y-%m-%d %H:%M:%S");
        std::cout << std::asctime(&tm);
}


works perfectly when built with gcc 12.0, or when built with clang 14 using
libc++ or libstdc++ versions prior to 12.0 -- but when using clang with
libstdc++ 12.0 (20220313 snapshot), it results in

In file included from test.cc:1:
In file included from
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/12.0.0/../../../../include/c++/12.0.0/iomanip:43:
In file included from
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/12.0.0/../../../../include/c++/12.0.0/locale:41:
In file included from
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/locale_facets_nonio.h:2069:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/locale_facets_nonio.tcc:1477:18:
error: reference to non-static member function must be called
      if ((void*)(this->*(&time_get::do_get)) == (void*)(&time_get::do_get))
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/12.0.0/../../../../include/c++/12.0.0/iomanip:433:20:
note: in instantiation of member function 'std::time_get<char>::get' requested
here
              __mg.get(_Iter(__is.rdbuf()), _Iter(), __is,
                   ^
test.cc:7:5: note: in instantiation of function template specialization
'std::operator>><char, std::char_traits<char>>' requested here
        ss >>std::get_time(&tm, "%Y-%m-%d %H:%M:%S");
           ^
1 error generated.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-21 10:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-20 11:04 [Bug libstdc++/104990] New: [12 Regression] std::get_time is incompatible with clang 14 bero at lindev dot ch
2022-03-20 12:41 ` [Bug libstdc++/104990] " jakub at gcc dot gnu.org
2022-03-20 13:11 ` bero at lindev dot ch
2022-03-21  0:51 ` pinskia at gcc dot gnu.org
2022-03-21  0:53 ` pinskia at gcc dot gnu.org
2022-03-21  8:56 ` rguenth at gcc dot gnu.org
2022-03-21  9:38 ` redi at gcc dot gnu.org
2022-03-21 10:03 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).