You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<source>:4:13: error: no viable constructor or deduction guide for deduction of template arguments of 'map' std::map m1 = {std::pair{"foo", 2}, {"bar", 3}}; // guide #2 ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:204:7: note: candidate template ignored: couldn't infer template argument '_Key' map(const _Compare& __comp, ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:283:2: note: candidate template ignored: couldn't infer template argument '_Key' map(_InputIterator __first, _InputIterator __last) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:238:7: note: candidate template ignored: could not match 'initializer_list' against 'pair' map(initializer_list<value_type> __l, ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:250:7: note: candidate template ignored: could not match 'map' against 'pair' map(const map& __m, const __type_identity_t<allocator_type>& __a) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:254:7: note: candidate template ignored: could not match 'map' against 'pair' map(map&& __m, const __type_identity_t<allocator_type>& __a) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:260:7: note: candidate template ignored: could not match 'initializer_list' against 'pair' map(initializer_list<value_type> __l, const allocator_type& __a) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:1472:5: note: candidate template ignored: substitution failure [with _InputIterator = std::pair<const char *, int>]: no member named 'value_type' in 'std::iterator_traits<std::pair<const char *, int>>' map(_InputIterator, _InputIterator, ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:1481:5: note: candidate template ignored: could not match 'initializer_list' against 'pair' map(initializer_list<pair<_Key, _Tp>>, ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:1494:5: note: candidate template ignored: could not match 'initializer_list' against 'pair' map(initializer_list<pair<_Key, _Tp>>, _Allocator) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:217:7: note: candidate function template not viable: requires 1 argument, but 2 were provided map(const map&) = default; ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:225:7: note: candidate function template not viable: requires 1 argument, but 2 were provided map(map&&) = default; ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:246:7: note: candidate function template not viable: requires single argument '__a', but 2 arguments were provided map(const allocator_type& __a) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:100:11: note: candidate function template not viable: requires 1 argument, but 2 were provided class map ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:266:2: note: candidate function template not viable: requires 3 arguments, but 2 were provided map(_InputIterator __first, _InputIterator __last, ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:1488:5: note: candidate function template not viable: requires 3 arguments, but 2 were provided map(_InputIterator, _InputIterator, _Allocator) ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:195:7: note: candidate function template not viable: requires 0 arguments, but 2 were provided map() = default; ^/opt/compiler-explorer/gcc-12.2.0/lib/gcc/x86_64-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_map.h:300:2: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided map(_InputIterator __first, _InputIterator __last, ^1 error generated.Compiler returned: 1
Activity
llvmbot commentedon May 24, 2023
@llvm/issue-subscribers-c-20
llvmbot commentedon May 24, 2023
@llvm/issue-subscribers-clang-frontend
shafik commentedon May 24, 2023
Code in question:
Diagnostic:
Note both gcc/MSVC accept: https://godbolt.org/z/6v4fvabb5
[Sema][CTAD] Allow user defined conversion for copy-list-initializati…
2 remaining items