Skip to content

Fantom's tester does not build with Clang 23: nlohmann_json 3.11.2 trips -Wdeprecated-literal-operator under -Werror #59667

Closed

Description

@YevheniiKotyrlo

Description

Fantom's tester does not build with a current Clang. React Native pins nlohmann_json 3.11.2 (packages/react-native/gradle/libs.versions.toml), whose json.hpp declares its literal operators with a space before the suffix, operator "" _json and operator "" _json_pointer. Clang 23 reports that form under -Wdeprecated-literal-operator, and the tester builds with -Werror, so yarn workspace @react-native/fantom build stops in json.hpp. Fantom's CI job builds with the apt Clang of its Ubuntu 22.04 image, so it does not see this.

nlohmann_json 3.12.0 drops the space (operator""_json), and the tester builds with it.

Steps to reproduce

  1. git clone https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer && cd react-native-fantom-reproducer
  2. ./fantom/reproduce.sh build (needs Docker). It builds the image in fantom/Dockerfile, which is React Native's Fantom CI image with Clang and LLD from LLVM 23.1.3 in place of the apt Clang, clones react/react-native at main, runs yarn install, and runs Fantom's CI build, yarn workspace @react-native/fantom build.

The same on a checkout of main, in that image: CC=clang CXX=clang++ LDFLAGS=-fuse-ld=lld yarn workspace @react-native/fantom build. buildFantomTester fails, and Gradle keeps the compiler's errors in private/react-native-fantom/build/reports/.

React Native Version

0.88.0 (reproduced on main at 54905a2)

Affected Platforms

Build - Linux

Output of npx @react-native-community/cli info

System:
  OS: Linux 6.18 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
  CPU: (24) x64 AMD Ryzen 9 9950X3D 16-Core Processor
  Memory: 116.43 GB / 125.63 GB
  Shell:
    version: 5.1.16
    path: /bin/bash
Binaries:
  Node:
    version: 22.14.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "37"
    Build Tools:
      - 37.0.0
    Android NDK: 28.2.13676358
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.20.1
    path: /usr/bin/javac
  Ruby:
    version: 3.0.2
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

/react-native/private/react-native-fantom/build/third-party/nlohmann_json/include/nlohmann/json.hpp:5136:35: error: identifier '_json' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
/react-native/private/react-native-fantom/build/third-party/nlohmann_json/include/nlohmann/json.hpp:5144:49: error: identifier '_json_pointer' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
/react-native/private/react-native-fantom/build/third-party/nlohmann_json/include/nlohmann/json.hpp:5208:58: error: identifier '_json' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]
/react-native/private/react-native-fantom/build/third-party/nlohmann_json/include/nlohmann/json.hpp:5209:58: error: identifier '_json_pointer' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator]

MANDATORY Reproducer

https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer

Screenshots and Videos

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions