public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94869] New: Template argument deduction/substitution failure with Howard Hinnant's calendar library
@ 2020-04-30  8:18 lcarreon at bigpond dot net.au
  2020-04-30  9:11 ` [Bug libstdc++/94869] [10 Regression] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: lcarreon at bigpond dot net.au @ 2020-04-30  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94869
           Summary: Template argument deduction/substitution failure with
                    Howard Hinnant's calendar library
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lcarreon at bigpond dot net.au
  Target Milestone: ---

The following bit of code used to compile ok with g++ 9.2.1.

#include <date.h>

int main()
{
    std::istringstream str{"2020-04-30 17:30:00.000"}; 
    std::chrono::local_time<std::chrono::milliseconds> loc_time;
    str >> date::parse("%Y-%m-%d %H:%M:%S", loc_time);
    return 0;
}

(NOTE: date.h is Howard Hinnant's sample implementation of the calendar library
included in C++20.)

However, when I compile with g++ 10.0.1 using this command line:

g++ -c -g -m64 -O3 -Wall -Werror -I/usr/local/include -std=c++2a dt.cpp

The compile fails with the following messages (excerpt only/incomplete):

dt.cpp:7:50: error: no matching function for call to ‘parse(const char [18],
std::chrono::local_time<std::chrono::duration<long int, std::ratio<1, 1000> >
>&)’
    7 |  str >> date::parse("%Y-%m-%d %H:%M:%S", loc_time);
      |                                                  ^
In file included from dt.cpp:1:
/usr/local/include/date.h:7827:1: note: candidate: ‘template<class Parsable,
class CharT, class Traits, class Alloc> decltype
((date::from_stream(declval<std::basic_istream<_CharT, _Traits>&>(),
format.c_str(), tp), date::parse_manip<Parsable, CharT, Traits, Alloc>{format,
tp})) date::parse(const std::__cxx11::basic_string<CharT, Traits, Alloc>&,
Parsable&)’
 7827 | parse(const std::basic_string<CharT, Traits, Alloc>& format, Parsable&
tp)
      | ^~~~~
/usr/local/include/date.h:7827:1: note:   template argument
deduction/substitution failed:
dt.cpp:7:50: note:   mismatched types ‘const std::__cxx11::basic_string<CharT,
Traits, Alloc>’ and ‘const char [18]’
    7 |  str >> date::parse("%Y-%m-%d %H:%M:%S", loc_time);
      |                                                  ^
In file included from dt.cpp:1:
/usr/local/include/date.h:7838:1: note: candidate: ‘template<class Parsable,
class CharT, class Traits, class Alloc> decltype
((date::from_stream(declval<std::basic_istream<_CharT, _Traits>&>(),
format.c_str(), tp, (& abbrev)), date::parse_manip<Parsable, CharT, Traits,
Alloc>{format, tp, (& abbrev)})) date::parse(const
std::__cxx11::basic_string<CharT, Traits, Alloc>&, Parsable&,
std::__cxx11::basic_string<CharT, Traits, Alloc>&)’
 7838 | parse(const std::basic_string<CharT, Traits, Alloc>& format, Parsable&
tp,
      | ^~~~~
/usr/local/include/date.h:7838:1: note:   template argument
deduction/substitution failed:
dt.cpp:7:50: note:   mismatched types ‘const std::__cxx11::basic_string<CharT,
Traits, Alloc>’ and ‘const char [18]’
    7 |  str >> date::parse("%Y-%m-%d %H:%M:%S", loc_time);

FYI, I will also notify Howard Hinnant of this issue because he might have a
clue as to the cause of the problem.

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

end of thread, other threads:[~2020-05-01  7:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30  8:18 [Bug c++/94869] New: Template argument deduction/substitution failure with Howard Hinnant's calendar library lcarreon at bigpond dot net.au
2020-04-30  9:11 ` [Bug libstdc++/94869] [10 Regression] " rguenth at gcc dot gnu.org
2020-04-30 13:48 ` redi at gcc dot gnu.org
2020-04-30 16:03 ` redi at gcc dot gnu.org
2020-04-30 16:05 ` redi at gcc dot gnu.org
2020-04-30 16:14 ` redi at gcc dot gnu.org
2020-04-30 21:41 ` lcarreon at bigpond dot net.au
2020-04-30 22:01 ` redi at gcc dot gnu.org
2020-04-30 22:28 ` lcarreon at bigpond dot net.au
2020-05-01  7:35 ` redi 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).