[PATCH] D41064: Suppress -Wuser-defined-literals for and
dim abandoned this revision. dim added a comment. Abandoned in favor of https://reviews.llvm.org/D41080. Repository: rCXX libc++ https://reviews.llvm.org/D41064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D41064: Suppress -Wuser-defined-literals for and
dim updated this revision to Diff 126397. dim added a comment. Updated to also include and . I think all cases are covered now. Repository: rCXX libc++ https://reviews.llvm.org/D41064 Files: include/chrono include/complex include/string include/string_view Index: include/string_view === --- include/string_view +++ include/string_view @@ -792,6 +792,10 @@ { inline namespace string_view_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR basic_string_view operator "" sv(const char *__str, size_t __len) _NOEXCEPT { @@ -815,6 +819,9 @@ { return basic_string_view (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/string === --- include/string +++ include/string @@ -4042,6 +4042,10 @@ { inline namespace string_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY basic_string operator "" s( const char *__str, size_t __len ) { @@ -4065,6 +4069,9 @@ { return basic_string (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/complex === --- include/complex +++ include/complex @@ -1444,6 +1444,10 @@ { inline namespace complex_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif constexpr complex operator""il(long double __im) { return { 0.0l, __im }; @@ -1475,6 +1479,9 @@ { return { 0.0f, static_cast(__im) }; } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/chrono === --- include/chrono +++ include/chrono @@ -1086,6 +1086,10 @@ { inline namespace chrono_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif constexpr chrono::hours operator""h(unsigned long long __h) { @@ -1152,6 +1156,9 @@ return chrono::duration (__ns); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif }} namespace chrono { // hoist the literals into namespace std::chrono Index: include/string_view === --- include/string_view +++ include/string_view @@ -792,6 +792,10 @@ { inline namespace string_view_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR basic_string_view operator "" sv(const char *__str, size_t __len) _NOEXCEPT { @@ -815,6 +819,9 @@ { return basic_string_view (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/string === --- include/string +++ include/string @@ -4042,6 +4042,10 @@ { inline namespace string_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY basic_string operator "" s( const char *__str, size_t __len ) { @@ -4065,6 +4069,9 @@ { return basic_string (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/complex === --- include/complex +++ include/complex @@ -1444,6 +1444,10 @@ { inline namespace complex_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif constexpr complex operator""il(long double __im) { return { 0.0l, __im }; @@ -1475,6 +1479,9 @@ { return { 0.0f, static_cast(__im) }; } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/chrono === --- include/chrono +++ include/chrono @@ -1086,6 +1086,10 @@ { inline namespace chrono_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif constexpr chrono::hours operator""h(unsigned long long __h) { @@ -1152,6 +1156,9 @@ return chrono::duration (__ns); } +#if defined(__clang__) +#pragma clang di
[PATCH] D41064: Suppress -Wuser-defined-literals for and
mclow.lists requested changes to this revision. mclow.lists added a comment. This revision now requires changes to proceed. In https://reviews.llvm.org/D41064#950946, @aaron.ballman wrote: > I think that it would be more appropriate to fix this in Clang rather than > libc++. For instance, we don't want libstdc++ to have to silence our same > diagnostic here. I agree. Repository: rCXX libc++ https://reviews.llvm.org/D41064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D41064: Suppress -Wuser-defined-literals for and
aaron.ballman added a comment. I think that it would be more appropriate to fix this in Clang rather than libc++. For instance, we don't want libstdc++ to have to silence our same diagnostic here. Repository: rCXX libc++ https://reviews.llvm.org/D41064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D41064: Suppress -Wuser-defined-literals for and
dim created this revision. When compiling and/or with -Wsystem-headers, in C++14 or higher mode, clang produces warnings about the literal suffixes defined in them, e.g.: $ cat test.cpp #include $ clang -std=c++14 -Wsystem-headers -Wall -Wextra -c test.cpp In file included from test.cpp:1: In file included from /usr/include/c++/v1/string:470: /usr/include/c++/v1/string_view:763:29: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string_view operator "" sv(const char *__str, size_t __len) ^ /usr/include/c++/v1/string_view:769:32: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string_view operator "" sv(const wchar_t *__str, size_t __len) ^ /usr/include/c++/v1/string_view:775:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string_view operator "" sv(const char16_t *__str, size_t __len) ^ /usr/include/c++/v1/string_view:781:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string_view operator "" sv(const char32_t *__str, size_t __len) ^ In file included from test.cpp:1: /usr/include/c++/v1/string:4012:24: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string operator "" s( const char *__str, size_t __len ) ^ /usr/include/c++/v1/string:4018:27: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string operator "" s( const wchar_t *__str, size_t __len ) ^ /usr/include/c++/v1/string:4024:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string operator "" s( const char16_t *__str, size_t __len ) ^ /usr/include/c++/v1/string:4030:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals] basic_string operator "" s( const char32_t *__str, size_t __len ) ^ 8 warnings generated. Similar to what is done in , suppress these warnings using `#pragma clang diagnostic`. Repository: rCXX libc++ https://reviews.llvm.org/D41064 Files: include/string include/string_view Index: include/string_view === --- include/string_view +++ include/string_view @@ -792,6 +792,10 @@ { inline namespace string_view_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR basic_string_view operator "" sv(const char *__str, size_t __len) _NOEXCEPT { @@ -815,6 +819,9 @@ { return basic_string_view (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/string === --- include/string +++ include/string @@ -4042,6 +4042,10 @@ { inline namespace string_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY basic_string operator "" s( const char *__str, size_t __len ) { @@ -4065,6 +4069,9 @@ { return basic_string (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/string_view === --- include/string_view +++ include/string_view @@ -792,6 +792,10 @@ { inline namespace string_view_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR basic_string_view operator "" sv(const char *__str, size_t __len) _NOEXCEPT { @@ -815,6 +819,9 @@ { return basic_string_view (__str, __len); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif } } #endif Index: include/string === --- include/string +++ include/string @@ -4042,6 +4042,10 @@ { inline namespace string_literals { +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuser-defined-literals" +#endif inline _LIBCPP_INLINE_VISIBILITY basic_string operator "" s( const char *__str, size_t __len ) { @@ -4065,6 +4069,9 @@ { return basic_string (__str, __len); } +#if defined(__cla