Skip to content

Compile-time error when building with Clang 13 #41

@suetanvil

Description

@suetanvil

When compiling using Clang 13 (macOS, XCode), the compile fails with the error message:

marshal.cpp:310:38: error: expected '(' for function-style cast or type construction
auto meta = hash_marshal_meta{*this, limit};
~~~~~~~~~~~~~~~~~^

hash_marshal_meta is a simple two-element struct.

What I think is happening is that Clang used to interpret the RHS as a C11-style struct initializer, a feature that isn't part of C++ but something that Clang supported as an extension. However, C++11 (IIRC) supports brace-style constructor arguments and as Clang supports more modern features, it's had to drop that particular fallback behaviour.

In any case, the right thing to do is just use a more traditional initialization syntax, which is what I have done. A pull request is on its way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions