<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/131136>131136</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[C++][concepts] error implicit instantiation of undefined template reported from checking constraint satisfaction
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
thbwd
</td>
</tr>
</table>
<pre>
```
#include <string>
template <template <typename> class SB>
concept Trait = requires(SB<int> a) { a.holder0; };
template <typename T> void set_property(T);
template <template <typename> class SB, typename ST>
void set_property(SB<ST> *) requires Trait<SB>;
void initialize(std::string *name) { set_property(name); }
```
Produces the following output:
```
% /opt/homebrew/Cellar/llvm/19.1.7_1/bin/clang test.cpp -std=c++20
In file included from test.cpp:1:
/opt/homebrew/Cellar/llvm/19.1.7_1/bin/../include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits<int>'
820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value,
| ^
test.cpp:4:40: note: in instantiation of template class 'std::basic_string<int>' requested here
4 | concept Trait = requires(SB<int> a) { a.holder0; };
| ^
test.cpp:4:39: note: in instantiation of requirement here
4 | concept Trait = requires(SB<int> a) { a.holder0; };
| ^~~~~~~~~
test.cpp:4:17: note: while substituting template arguments into constraint expression here
4 | concept Trait = requires(SB<int> a) { a.holder0; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.cpp:9:38: note: while checking the satisfaction of concept 'Trait<std::basic_string>' requested here
9 | void set_property(SB<ST> *) requires Trait<SB>;
| ^~~~~~~~~
test.cpp:9:38: note: while substituting template arguments into constraint expression here
9 | void set_property(SB<ST> *) requires Trait<SB>;
| ^~~~~~~~~
test.cpp:11:38: note: while checking constraint satisfaction for template 'set_property<std::basic_string, char>' required here
11 | void initialize(std::string *name) { set_property(name); }
| ^~~~~~~~~~~~
test.cpp:11:38: note: in instantiation of function template specialization 'set_property<std::basic_string, char>' requested here
/opt/homebrew/Cellar/llvm/19.1.7_1/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here
23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
| ^
1 error generated.
```
This compiles fine with 18.1.8.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8Vk9v47YT_TTjC7GCRFqWfPBB_gcssD8gwBq_q0BJI4utTKokFTc99LMXpGTHauK63aYhksAOyZn35j0OyY0RR4m4gngN8XbGe9sovbJNca5mhapeVrAIx58wA8qELNu-QgJsY6wW8ghs52bCzOKpa7n1U5PPLx1KfkJgO1K23BjyfT1sKpUssbPkoLmwBNiWaPylFxoN0NQt2ghp3TYOdEkgWRMeNKqtUIfA1gSSLbD1O8nHhOTg9j4rURGDNu-06lDbF6DpAejy_a2PcNMNuYb_fhhovJfBo_cLCNDMwb9QG9i6WV-FCwofREhhBW_Fbwg0NbYClgHLhjq7OB7OWIo_JRynLnUJs4luYfakVdWXaIhtkNSqbdXZBVW97Xrr8vhVU7FjAnSvOgt036gTFhrPQPcbbFuuge7b9vkEdB8tgyhI8gjovhAS6L5suTwSi8YGZdeRL57ItgS6BrqmLvRXSWrRIhnNVJFaq9N1B7AsGhH9SPogALofIzs0Q16g-2e35mLaLKUhsGxOgWUEtVbafRCnrhWlsERIY7m0gluhJFE16WWFtZBYkVeP0OSqUdlwnVunrLnaFmgCYUZSGhJINoQQY7kVZc6NQW2BpsLkxhtsk28arg8Tdw3Bcvf9NoX_uhv-88zbHoFuXBY_XBqId97U11rO3a_jSqSy6FnKt_yurAar33IruBFlfincKzlvaTQWK9KgxhHF3KP4qKP9gBdbPuI1pj2htJ-E8vdxvEUbJbdoz407AqYvjBW2t8KfmVEEro-9g2yIkFY5nMb5QVqCv3YajXHsPpfO3THl6QRh6VueZYPlz55jg8RwK0zNy4tIF-BAk0t3vOO--75besD_vhf_DS3vcfwYLT-RSBQ9UusG7US0WulpI7xFek89uiGuid2oKPRExCh65f6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