Skip to content

Fails to compile with g++ 15 #7683

@mohe2015

Description

@mohe2015

The repository currently fails to compile with g++ 15 (e.g. on Fedora):

[ 60%] Building CXX object CMakeFiles/binaryen.dir/src/passes/ReReloop.cpp.o
In file included from /usr/include/c++/15/functional:61,
                 from /home/moritz/Documents/binaryen/src/passes/Strip.cpp:22:
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = bool; _ArgTypes = {wasm::CustomSection&}]’,
    inlined from ‘wasm::Strip::Strip(Decider)’ at /home/moritz/Documents/binaryen/src/passes/Strip.cpp:37:28,
    inlined from ‘wasm::Pass* wasm::createStripDebugPass()’ at /home/moritz/Documents/binaryen/src/passes/Strip.cpp:62:4:
/usr/include/c++/15/bits/std_function.h:393:17: error: ‘<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
  393 |             __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
      |             ~~~~^~~~~~~~~~
/usr/include/c++/15/bits/std_function.h: In function ‘wasm::Pass* wasm::createStripDebugPass()’:
/usr/include/c++/15/bits/std_function.h:269:7: note: by argument 2 of type ‘const std::_Any_data&’ to ‘static bool std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Res = bool; _Functor = wasm::createStripDebugPass()::<lambda(const wasm::CustomSection&)>; _ArgTypes = {wasm::CustomSection&}]’ declared here
  269 |       _M_manager(_Any_data& __dest, const _Any_data& __source,
      |       ^~~~~~~~~~
/home/moritz/Documents/binaryen/src/passes/Strip.cpp:58:20: note: ‘<anonymous>’ declared here
   58 |   return new Strip([&](const CustomSection& curr) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   59 |     return curr.name == BinaryConsts::CustomSections::Name ||
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 |            curr.name == BinaryConsts::CustomSections::SourceMapUrl ||
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   61 |            curr.name.find(".debug") == 0 || curr.name.find("reloc..debug") == 0;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   62 |   });
      |   ~                 
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = bool; _ArgTypes = {wasm::CustomSection&}]’,
    inlined from ‘wasm::Strip::Strip(Decider)’ at /home/moritz/Documents/binaryen/src/passes/Strip.cpp:37:28,
    inlined from ‘wasm::Pass* wasm::createStripDWARFPass()’ at /home/moritz/Documents/binaryen/src/passes/Strip.cpp:68:4:
/usr/include/c++/15/bits/std_function.h:393:17: error: ‘<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
  393 |             __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
      |             ~~~~^~~~~~~~~~
/usr/include/c++/15/bits/std_function.h: In function ‘wasm::Pass* wasm::createStripDWARFPass()’:
/usr/include/c++/15/bits/std_function.h:269:7: note: by argument 2 of type ‘const std::_Any_data&’ to ‘static bool std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Res = bool; _Functor = wasm::createStripDWARFPass()::<lambda(const wasm::CustomSection&)>; _ArgTypes = {wasm::CustomSection&}]’ declared here
  269 |       _M_manager(_Any_data& __dest, const _Any_data& __source,
      |       ^~~~~~~~~~
/home/moritz/Documents/binaryen/src/passes/Strip.cpp:66:20: note: ‘<anonymous>’ declared here
   66 |   return new Strip([&](const CustomSection& curr) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   67 |     return curr.name.find(".debug") == 0 || curr.name.find("reloc..debug") == 0;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |   });
      |   ~                 
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = bool; _ArgTypes = {wasm::CustomSection&}]’,
    inlined from ‘wasm::Strip::Strip(Decider)’ at /home/moritz/Documents/binaryen/src/passes/Strip.cpp:37:28,
    inlined from ‘wasm::Pass* wasm::createStripProducersPass()’ at /home/moritz/Documents/binaryen/src/passes/Strip.cpp:74:4:
/usr/include/c++/15/bits/std_function.h:393:17: error: ‘<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
  393 |             __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
      |             ~~~~^~~~~~~~~~
/usr/include/c++/15/bits/std_function.h: In function ‘wasm::Pass* wasm::createStripProducersPass()’:
/usr/include/c++/15/bits/std_function.h:269:7: note: by argument 2 of type ‘const std::_Any_data&’ to ‘static bool std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Res = bool; _Functor = wasm::createStripProducersPass()::<lambda(const wasm::CustomSection&)>; _ArgTypes = {wasm::CustomSection&}]’ declared here
  269 |       _M_manager(_Any_data& __dest, const _Any_data& __source,
      |       ^~~~~~~~~~
/home/moritz/Documents/binaryen/src/passes/Strip.cpp:72:20: note: ‘<anonymous>’ declared here
   72 |   return new Strip([&](const CustomSection& curr) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   73 |     return curr.name == BinaryConsts::CustomSections::Producers;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   74 |   });
      |   ~                 
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-implicit-int-float-conversion’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/binaryen.dir/build.make:1731: CMakeFiles/binaryen.dir/src/passes/Strip.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:488: CMakeFiles/binaryen.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

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