[libcxx-dev] std::ctype, std::numpunct base templates

James Skene via libcxx-dev libcxx-dev at lists.llvm.org
Mon Aug 3 20:25:02 PDT 2020


Hi,

I'm considering submitting a bug report against libc++, but thought I would
check here first.

The standard gives a synopsis for the locale facet std::ctype<CharT> in
Section 25.4.1 (C++17, but it is also in C++11), and std::numpunct<CharT>
in Section 25.4.3.  Under libc++ specialisations of these templates are
defined for char and wchar_t (in header '__locale') but the base template
definition is omitted.  This means in particular that I cannot define:

class my_ctype : public std::ctype<char16_t> { ... };

class my_numpunct : public std::numpunct<char16_t> { ... };

This seems to go against the intent of these classes, which include
abstract virtual function declarations.  Although clause 30.2.2 restricts
the support for stream-based I/O that an implementation must provide to the
types char and wchar_t, it is not clear to me that this means the
definitions of the above templates can be omitted.

I would appreciate advice as to: a. whether this is actually an issue or my
misreading of the spec; and b. if so, if it is a known issue.

Thanks a lot!
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20200804/1d3cd5a4/attachment.html>


More information about the libcxx-dev mailing list