Skip to content

GCC 15 compilation errors #3183

Open
@bread-mountain4

Description

@bread-mountain4

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Other

Expected Behaviour

Compilation success

Actual Behaviour

There was a compilation error:

gcc -MMD -MT build/obj/code_format/SymSpell.obj -MF build/obj/code_format/SymSpell.obj.d -std=c++17 -O2 -Wall -fvisibility=hidden -I3rd/EmmyLuaCodeStyle/Util/include -I3rd/EmmyLuaCodeStyle/CodeFormatCore/include -I3rd/EmmyLuaCodeStyle/LuaParser/include -I3rd/bee.lua/3rd/lua -I3rd/EmmyLuaCodeStyle/3rd/wildcards/include -DNDEBUG -Wall -Werror -o build/obj/code_format/SymSpell.obj -c 3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp
In file included from 3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:1:
3rd/EmmyLuaCodeStyle/Util/include/Util/SymSpell/SymSpell.h:72:5: error: ‘uint32_t’ does not name a type
   72 |     uint32_t _compactMask;
      |     ^~~~~~~~
3rd/EmmyLuaCodeStyle/Util/include/Util/SymSpell/SymSpell.h:32:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
   31 | #include <vector>
  +++ |+#include <cstdint>
   32 | 
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp: In constructor ‘SymSpell::SymSpell(Strategy, int, int)’:
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:14:7: error: class ‘SymSpell’ does not have any field named ‘_compactMask’
   14 |       _compactMask((std::numeric_limits<uint32_t>::max() >> 8) << 2),
      |       ^~~~~~~~~~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:14:41: error: ‘uint32_t’ was not declared in this scope
   14 |       _compactMask((std::numeric_limits<uint32_t>::max() >> 8) << 2),
      |                                         ^~~~~~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:9:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
    8 | #include <sstream>
  +++ |+#include <cstdint>
    9 | 
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:14:49: error: template argument 1 is invalid
   14 |       _compactMask((std::numeric_limits<uint32_t>::max() >> 8) << 2),
      |                                                 ^
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp: In member function ‘int SymSpell::GetStringHash(std::string_view)’:
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:325:5: error: ‘uint32_t’ was not declared in this scope
  325 |     uint32_t lenMask = static_cast<uint32_t>(source.size());
      |     ^~~~~~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:325:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:326:9: error: ‘lenMask’ was not declared in this scope
  326 |     if (lenMask > 3) {
      |         ^~~~~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:329:13: error: expected ‘;’ before ‘hash’
  329 |     uint32_t hash = 2166136261;
      |             ^~~~~
      |             ;
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:332:9: error: ‘hash’ was not declared in this scope; did you mean ‘std::hash’?
  332 |         hash ^= c;
      |         ^~~~
      |         std::hash
In file included from /usr/include/c++/15.1.1/string_view:52,
                 from 3rd/EmmyLuaCodeStyle/Util/include/Util/SymSpell/IDistance.h:2,
                 from 3rd/EmmyLuaCodeStyle/Util/include/Util/SymSpell/EditDistance.h:3,
                 from 3rd/EmmyLuaCodeStyle/Util/include/Util/SymSpell/SymSpell.h:24:
/usr/include/c++/15.1.1/bits/functional_hash.h:68:12: note: ‘std::hash’ declared here
   68 |     struct hash;
      |            ^~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:336:5: error: ‘hash’ was not declared in this scope; did you mean ‘std::hash’?
  336 |     hash &= _compactMask;
      |     ^~~~
      |     std::hash
/usr/include/c++/15.1.1/bits/functional_hash.h:68:12: note: ‘std::hash’ declared here
   68 |     struct hash;
      |            ^~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:336:13: error: ‘_compactMask’ was not declared in this scope
  336 |     hash &= _compactMask;
      |             ^~~~~~~~~~~~
3rd/EmmyLuaCodeStyle/Util/src/SymSpell/SymSpell.cpp:337:13: error: ‘lenMask’ was not declared in this scope
  337 |     hash |= lenMask;
      |             ^~~~~~~
[88/94] Compile C   build/obj/source_lua/onelua.obj
ninja: build stopped: subcommand failed.

Reproduction steps

  1. Use GCC 15 (I'm using 15.1.1 20250425)
  2. Compile lua-language-server

Additional Notes

It looks like the submodule for emmyluacodestyle needs to be revved again. There's this commit CppCXY/EmmyLuaCodeStyle@de28a26 mentioning that it fixes GCC 15 compilation errors.

Log File

No response

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