[odb-users] Internal compiler error linked to spdlog

Boris Kolpackov boris at codesynthesis.com
Mon May 4 10:11:21 EDT 2020

Sean Clarke <sean.clarke at sec-consulting.co.uk> writes:

> Has anyone else seen anything similar?

I was able to reproduce and fix this based on your description (details
for those interested below).

I've also staged the fix so if you would like to give it a try, just
follow the build2-based installation instructions[1] but use this


Instead of:


To get ODB.

(I believe you should be able to use the 0.12.0 build2 toolchain but if
not, upgrade to staged[2].)

Now, if anyone is interested, the problem was caused by this code in

namespace spdlog
  class logger
    log_err_handler err_handler_{[this](const std::string &msg) { this->default_err_handler_(msg); }};

It appears that in GCC's AST this is represented as an injected into
the spdlog namespace class-type that implements the lambda. It turns
out such a type cannot be treated as an ordinary class which is what
ODB tried to do. The fix is simply to ignore such lambda classes since
there is nothing interesting about them from the ODB's POV.

Here is the commit that fixes this:


[1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml
[2] https://build2.org/community.xhtml#stage

More information about the odb-users mailing list