Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 3 years ago

Language

C++

Compiler

gcc HEAD 12.0.0 20210721 (experimental)

Options
Warnings
Boost 1.73.0
C++2b
no pedantic

Author

anonymous

over 3 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=c++2b
prog.cc: In function 'int main()':
prog.cc:13:51: error: class template argument deduction failed:
   13 |     [[maybe_unused]] std_array_with_3 ar3 = {1,2,3};//ng
      |                                                   ^
prog.cc:13:51: error: no matching function for call to 'array(int, int, int)'
In file included from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/array:267:5: note: candidate: 'template<class T, class _Tp, class ... _Up> std::array(_Tp, _Up ...)-> std::array<typename std::enable_if<(is_same_v<_Tp, _Up> && ...), _Tp>::type, (1 + sizeof... (_Up))> requires  __is_same(std::std_array_with_3<T>, std::array<typename std::enable_if<(is_same_v<_Tp, _Up> && ...), _Tp>::type, 1 + sizeof ... (_Up ...)>)'
  267 |     array(_Tp, _Up...)
      |     ^~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/array:267:5: note:   template argument deduction/substitution failed:
prog.cc:13:51: note:   couldn't deduce template parameter 'T'
   13 |     [[maybe_unused]] std_array_with_3 ar3 = {1,2,3};//ng
      |                                                   ^
In file included from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/array:95:12: note: candidate: 'template<class T> array(std::array<T, 3>)-> std::array<T, 3>'
   95 |     struct array
      |            ^~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/array:95:12: note:   template argument deduction/substitution failed:
prog.cc:13:51: note:   mismatched types 'std::array<T, 3>' and 'int'
   13 |     [[maybe_unused]] std_array_with_3 ar3 = {1,2,3};//ng
      |                                                   ^
In file included from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/array:95:12: note: candidate: 'template<class T> array()-> std::array<T, 3>'
   95 |     struct array
      |            ^~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/array:95:12: note:   template argument deduction/substitution failed:
prog.cc:13:51: note:   candidate expects 0 arguments, 3 provided
   13 |     [[maybe_unused]] std_array_with_3 ar3 = {1,2,3};//ng
      |                                                   ^
Exit Code:
1