Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: "cannot assign to non-static data member" caused by obsolete version of "flatbuffer" #893

Open
XiaochenCui opened this issue Jan 8, 2025 · 0 comments · Fixed by #916
Assignees
Labels
bug Something isn't working

Comments

@XiaochenCui
Copy link

Describe what's wrong

Got error when build from scratch, using llvm-20.

How to reproduce

create file CMakePresets.json:

{
  "version": 3,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 21,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "llvm17",
      "generator": "Ninja",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "/usr/lib/llvm-17/bin/clang",
        "CMAKE_CXX_COMPILER": "/usr/lib/llvm-17/bin/clang++"
      }
    },
    {
      "name": "llvm20",
      "generator": "Ninja",
      "cacheVariables": {
        "CMAKE_C_COMPILER": "/usr/lib/llvm-20/bin/clang",
        "CMAKE_CXX_COMPILER": "/usr/lib/llvm-20/bin/clang++"
      }
    }
  ]
}
# build using llvm-20
cmake . -B build --preset llvm20
ninja -C build

Error message and/or stacktrace

[build] /home/xiaochen/code/proton/contrib/flatbuffers/include/flatbuffers/stl_emulation.h:549:12: error: cannot assign to non-static data member 'count_' with const-qualified type 'const size_type' (aka 'const unsigned long')
[build]   549 |     count_ = other.count_;
[build]       |     ~~~~~~ ^
[build] /home/xiaochen/code/proton/contrib/flatbuffers/include/flatbuffers/stl_emulation.h:628:19: note: non-static data member 'count_' declared const here
[build]   628 |   const size_type count_;
[build]       |   ~~~~~~~~~~~~~~~~^~~~~~
[build] 1 error generated.

Additional context

This issue was also reported at:
CleverRaven/Cataclysm-DDA#77355
and is fixed at:
google/flatbuffers@20aad0c

I'm going to update its version to new and do some verification to ensure the correctness and performance.

@XiaochenCui XiaochenCui added the bug Something isn't working label Jan 8, 2025
@yokofly yokofly self-assigned this Feb 28, 2025
@yokofly yokofly linked a pull request Mar 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants