Skip to content

Compile errors with GCC 7.1 and below #3096

Closed
@sergiud

Description

@sergiud

scan-test.cc fails to compile with GCC 7.1 and older issuing the following errors:

<source>:172:21: error: enclosing class of constexpr non-static member function 'int fmt::v9::detail::scan_handler::on_arg_id()' is not a literal type
   FMT_CONSTEXPR int on_arg_id() { return on_arg_id(next_arg_id_++); }
                     ^~~~~~~~~
<source>:125:8: note: 'fmt::v9::detail::scan_handler' is not literal because:
 struct scan_handler : error_handler {
        ^~~~~~~~~~~~
<source>:125:8: note:   'fmt::v9::detail::scan_handler' is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
<source>:173:21: error: enclosing class of constexpr non-static member function 'int fmt::v9::detail::scan_handler::on_arg_id(int)' is not a literal type
   FMT_CONSTEXPR int on_arg_id(int id) {
                     ^~~~~~~~~
<source>:178:21: error: enclosing class of constexpr non-static member function 'int fmt::v9::detail::scan_handler::on_arg_id(fmt::v9::string_view)' is not a literal type
   FMT_CONSTEXPR int on_arg_id(string_view id) {
                     ^~~~~~~~~
Compiler returned: 1

Reproducer: https://godbolt.org/z/jcxnx7MeT. A workaround is to remove FMT_CONSTEXPR from failing methods.

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