Author
anonymous
over 1 year ago
Language
C++
Compiler
gcc HEAD 14.0.0 20231109 (experimental)
Options
Warnings
Don't Use Boost
C++2b
no pedantic
Author
anonymous
over 1 year ago
$ g++ prog.cc -Wall -Wextra -std=c++2b
prog.cc: In function 'int main()':
prog.cc:12:10: error: no match for 'operator+=' (operand types are 'std::chrono::year_month_day' and 'std::chrono::days' {aka 'std::chrono::duration<long int, std::ratio<86400> >'})
12 | date += days{1};
| ~~~~~^~~~~~~~~~
In file included from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/14.0.0/chrono:1559:9: note: candidate: 'template<class> constexpr std::chrono::year_month_day& std::chrono::year_month_day::operator+=(const std::chrono::months&)'
1559 | operator+=(const months& __m) noexcept
| ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/14.0.0/chrono:1559:9: note: template argument deduction/substitution failed:
prog.cc:12:13: note: cannot convert 'std::chrono::duration<long int, std::ratio<86400> >(1)' (type 'std::chrono::days' {aka 'std::chrono::duration<long int, std::ratio<86400> >'}) to type 'const std::chrono::months&' {aka 'const std::chrono::duration<long int, std::ratio<2629746> >&'}
12 | date += days{1};
| ^~~~~~~
/opt/wandbox/gcc-head/include/c++/14.0.0/chrono:1574:7: note: candidate: 'constexpr std::chrono::year_month_day& std::chrono::year_month_day::operator+=(const std::chrono::years&)'
1574 | operator+=(const years& __y) noexcept
| ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/14.0.0/chrono:1574:31: note: no known conversion for argument 1 from 'std::chrono::days' {aka 'std::chrono::duration<long int, std::ratio<86400> >'} to 'const std::chrono::years&' {aka 'const std::chrono::duration<long int, std::ratio<31556952> >&'}
1574 | operator+=(const years& __y) noexcept
| ~~~~~~~~~~~~~^~~
Exit Code:
1