Closed
Description
Bugzilla Link | 50276 |
Version | trunk |
OS | Windows NT |
CC | @Ivan171,@zygoloid |
Extended Description
$ cat utf.cpp
#include <concepts>
template <typename>
struct utf_t;
template <typename T>
requires (std::is_same_v<T, char32_t>) ||
(std::is_same_v<T, wchar_t> && sizeof(wchar_t) == sizeof(char32_t))
struct utf_t<T> {
utf_t() {
}
template <typename Input>
static auto length(Input begin, Input const end) -> unsigned;
};
template <typename T>
requires (std::is_same_v<T, char32_t>) ||
(std::is_same_v<T, wchar_t> && sizeof(wchar_t) == sizeof(char32_t))
template <typename Input>
inline auto utf_t<T>::length(Input begin, Input const end) -> unsigned {
return 0;
}
$ clang++ -std=c++20 utf.cpp
utf.cpp:21:23: error: out-of-line definition of 'length' from class 'utf_t<type-parameter-0-0>' without definition
inline auto utf_t<T>::length(Input begin, Input const end) -> unsigned {
~~~~~~~~~~^
1 error generated.
No matter how you constrain it, it doesn't work: https://godbolt.org/z/qqaM89nTx
GCC compiles it without any error: https://godbolt.org/z/PM3seoYvW
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done