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

FMT_USE_TRAILING_RETURN not defined on clang, causes warnings #715

Closed
eliaskosunen opened this issue Apr 19, 2018 · 2 comments
Closed

FMT_USE_TRAILING_RETURN not defined on clang, causes warnings #715

eliaskosunen opened this issue Apr 19, 2018 · 2 comments

Comments

@eliaskosunen
Copy link
Contributor

eliaskosunen commented Apr 19, 2018

Please see this CE snippet: https://godbolt.org/g/CVWCax

As a solution, I propose either:

  • adding a macro FMT_HAS_CXX11, that checks for __cplusplus and/or compiler versions.
  • defining FMT_HAS_GXX_CXX11 as a non-zero value on clang as well

I'm not proposing:

  • defining FMT_USE_TRAILING_RETURN to zero instead of not defining it at all,

as this would lead to trailing returns to not be used on clang.

Once we reach a solution, I can submit a PR.

@eliaskosunen
Copy link
Contributor Author

As an aside, to avoid these kinds of problems in the future, Travis CI could test with more compilers. At the moment, only g++-6 is used on Linux. Clang with -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-exit-time-destructors yields, in my opinion, much better warnings than g++.

@vitaut
Copy link
Contributor

vitaut commented Apr 22, 2018

I think the simplest fix is to define FMT_USE_TRAILING_RETURN whenever __has_feature(cxx_trailing_return) is defined (in addition to the existing conditions). PR is welcome!

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

No branches or pull requests

2 participants