Skip to content

Commit

Permalink
Silence Clang 18 warning (#762)
Browse files Browse the repository at this point in the history
The Clang 18 roll here flutter/engine#45486 will
add a new warning like:

we get errors of the form:
```
../../third_party/json/include\nlohmann/json.hpp(5142,35): error: identifier '_json' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
 5142 | inline nlohmann::json operator "" _json(const char* s, std::size_t n)
      |                       ~~~~~~~~~~~~^~~~~
      |                       operator""_json
```

That is, Clang rejects `operator "" _a` unless spaces are removed. This
PR adds a flag to silence the warning util it is fixed upstream.
  • Loading branch information
zanderso authored Sep 6, 2023
1 parent e6f6fba commit 9bbdc3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ if (is_win) {

# Unqualified std::move is pretty common.
"-Wno-unqualified-std-cast-call",

# Needed for nlohmann/json.
"-Wno-deprecated-literal-operator",
]
}
} else {
Expand Down Expand Up @@ -666,6 +669,9 @@ if (is_win) {

# Needed for compiling Skia with clang-12
"-Wno-psabi",

# Needed for nlohmann/json.
"-Wno-deprecated-literal-operator",
]
if (!is_wasm) {
default_warning_flags += [
Expand Down

0 comments on commit 9bbdc3f

Please sign in to comment.