[cfe-dev] clang warns on libcxx chrono and string usage of user-defined literals

Yaron Keren yaron.keren at gmail.com
Mon Sep 30 23:48:18 PDT 2013


Hi,

Trying to compile libcxx using ToT clang results in several warnings such
as:

libcxx/string:4169:24: warning: user-defined literal suffixes not starting
with '_' are reserved
    basic_string<char> operator "" s( const char *__str, size_t __len )

libcxx/chrono:955:29: warning: user-defined literal suffixes not starting
with '_' are reserved
    constexpr chrono::hours operator"" h(unsigned long long __h)
                       ^
debugging, I see Sema::CheckLiteralOperatorDeclaration calling
NumericLiteralParser::isValidUDSuffix which returns true (valid) for the
"s" and "h" suffixes.  This prevents the second optional part of the
warning, "no literal will invoke this operator" but not the first one shown
above.

Yaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131001/e3f997de/attachment.html>


More information about the cfe-dev mailing list