Skip to content

Compile errors with GCC 7.1 and below #3096

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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