Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors with GCC 7.1 and below #3096

Closed
sergiud opened this issue Sep 11, 2022 · 0 comments · Fixed by #3097
Closed

Compile errors with GCC 7.1 and below #3096

sergiud opened this issue Sep 11, 2022 · 0 comments · Fixed by #3097

Comments

@sergiud
Copy link
Contributor

sergiud commented Sep 11, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant