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

Latest version of format package does not compile with C++98 #12

Closed
gcflymoto opened this issue Dec 9, 2013 · 5 comments
Closed

Latest version of format package does not compile with C++98 #12

gcflymoto opened this issue Dec 9, 2013 · 5 comments

Comments

@gcflymoto
Copy link
Contributor

/format.h: In function 'fmt::Formatter<fmt::NoAction, char> fmt::Format(fmt::StringRef)':
/format.h:1112: error: 'fmt::Formatter<Action, Char>::Formatter(const fmt::Formatter<Action, Char>&) [with Action = fmt::NoAction, Char = char]' is private
/format.h:1226: error: within this context
/format.h: In function 'fmt::Formatter<fmt::NoAction, wchar_t> fmt::Format(fmt::WStringRef)':
/format.h:1112: error: 'fmt::Formatter<Action, Char>::Formatter(const fmt::Formatter<Action, Char>&) [with Action = fmt::NoAction, Char = wchar_t]' is private
/format.h:1230: error: within this context
/format.h: In function 'fmt::Formatter<fmt::Write, char> fmt::Print(fmt::StringRef)':
/format.h:1112: error: 'fmt::Formatter<Action, Char>::Formatter(const fmt::Formatter<Action, Char>&) [with Action = fmt::Write, Char = char]' is private
/format.h:1246: error: within this context
In file included from /format.cc:34:
/format.h: In function 'fmt::Formatter<fmt::NoAction, char> fmt::Format(fmt::StringRef)':
/format.h:1112: error: 'fmt::Formatter<Action, Char>::Formatter(const fmt::Formatter<Action, Char>&) [with Action = fmt::NoAction, Char = char]' is private
/format.h:1226: error: within this context
/format.h: In function 'fmt::Formatter<fmt::NoAction, wchar_t> fmt::Format(fmt::WStringRef)':
/format.h:1112: error: 'fmt::Formatter<Action, Char>::Formatter(const fmt::Formatter<Action, Char>&) [with Action = fmt::NoAction, Char = wchar_t]' is private
/format.h:1230: error: within this context
/format.h: In function 'fmt::Formatter<fmt::Write, char> fmt::Print(fmt::StringRef)':
/format.h:1112: error: 'fmt::Formatter<Action, Char>::Formatter(const fmt::Formatter<Action, Char>&) [with Action = fmt::Write, Char = char]' is private
/format.h:1246: error: within this context

@vitaut
Copy link
Contributor

vitaut commented Dec 9, 2013

Sorry, I can't reproduce it here. What compiler do you use?

@gcflymoto
Copy link
Contributor Author

GCC 4.2.2

@gcflymoto
Copy link
Contributor Author

This iss because the new version is not backward compatible anymore with C++98 instead I had to add

g++ -std=c++11

without out GCC4.8.1 fails with

/tmp/format.h:919:5: error: identifier 'noexcept' is a keyword in C++11 [-Werror=c++0x-compat]
~Arg() FMT_NOEXCEPT(false) {
^
/tmp/format.h:919:10: error: expected ';' at end of member declaration
~Arg() FMT_NOEXCEPT(false) {
^
/tmp/format.h:919:25: error: expected identifier before 'false'
~Arg() FMT_NOEXCEPT(false) {
^
/tmp/format.h:54:38: note: in definition of macro 'FMT_NOEXCEPT'

define FMT_NOEXCEPT(expr) noexcept(expr)

                                  ^

/tmp/format.h:919:25: error: expected ',' or '...' before 'false'
~Arg() FMT_NOEXCEPT(false) {
^
/tmp/format.h:54:38: note: in definition of macro 'FMT_NOEXCEPT'

define FMT_NOEXCEPT(expr) noexcept(expr)

                                  ^

/tmp/format.h:54:42: error: ISO C++ forbids declaration of 'noexcept' with no type [-fpermissive]

define FMT_NOEXCEPT(expr) noexcept(expr)

@gcflymoto
Copy link
Contributor Author

Unfortunately our project is still on 4.2.2 and next year it will move up, so for now I'm stuck unless it's possible to maintain compatibility with old GCC versions.

@vitaut
Copy link
Contributor

vitaut commented Dec 10, 2013

This should be fixed by 8ca31c8 & 2d485d1. I don't have GCC 4.2.2 to test though so feel free to reopen the issue if the compilation errors persist.

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