Skip to content

Commit

Permalink
-Wdeprecated-literal-operator fixes
Browse files Browse the repository at this point in the history
Summary:
Fix deprecated literal operators:
```
./xplat/folly/FixedString.h:2923:1: error: identifier '_fs64' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
 2923 | FOLLY_DEFINE_FIXED_STRING_UDL(64)
      | ^
./xplat/folly/FixedString.h:2912:39: note: expanded from macro 'FOLLY_DEFINE_FIXED_STRING_UDL'
 2912 |   constexpr FixedString<N> operator"" _fs##N(                \
      |                                       ^
```

Reviewed By: drodriguez

Differential Revision: D57494889

fbshipit-source-id: 7120f44d28abdcc6b8cd4dfa86a78c6903d805ab
  • Loading branch information
rmaz authored and facebook-github-bot committed May 20, 2024
1 parent 75e0eae commit 89ac845
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions folly/FixedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -2900,7 +2900,7 @@ constexpr const std::size_t& npos = detail::fixedstring::FixedStringBase::npos;
* `FixedString<8>`, `FixedString<16>`, etc.
*/
template <class Char, Char... Cs>
constexpr BasicFixedString<Char, sizeof...(Cs)> operator"" _fs() noexcept {
constexpr BasicFixedString<Char, sizeof...(Cs)> operator""_fs() noexcept {
const Char a[] = {Cs..., Char(0)};
return {+a, sizeof...(Cs)};
}
Expand All @@ -2909,7 +2909,7 @@ constexpr BasicFixedString<Char, sizeof...(Cs)> operator"" _fs() noexcept {
#endif

#define FOLLY_DEFINE_FIXED_STRING_UDL(N) \
constexpr FixedString<N> operator"" _fs##N( \
constexpr FixedString<N> operator""_fs##N( \
const char* that, std::size_t count) noexcept(false) { \
return {that, count}; \
} \
Expand Down
2 changes: 1 addition & 1 deletion folly/system/Shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct ShellCmdFormat {

inline namespace literals {
inline namespace shell_literals {
constexpr detail::ShellCmdFormat operator"" _shellify(
constexpr detail::ShellCmdFormat operator""_shellify(
char const* name, std::size_t length) {
return {folly::StringPiece(name, length)};
}
Expand Down

0 comments on commit 89ac845

Please sign in to comment.