Skip to content

compatible for c++11 but GCC < - #884

Merged
HowardHinnant merged 2 commits into
HowardHinnant:masterfrom
aengusjiang:master
Jun 27, 2025
Merged

HowardHinnant merged 2 commits into
HowardHinnant:masterfrom
aengusjiang:master

Conversation

@aengusjiang

Copy link
Copy Markdown
Contributor

a little change to support c++11 but GCC < 5, such as centos7.9 gcc4.8.5

Comment thread include/date/date.h Outdated
# pragma warning(disable : 4127)
#endif

#if (defined(__GNUC__) && __GNUC__ < 5) || defined(_MSC_VER)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why " || defined(_MSC_VER)"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I will remove it

@HowardHinnant
HowardHinnant merged commit bce5f54 into HowardHinnant:master Jun 27, 2025
HowardHinnant pushed a commit that referenced this pull request Jun 27, 2025
@botanegg

botanegg commented Aug 12, 2025 •

Copy link
Copy Markdown
Contributor

Still warn on clang

warning: identifier '_y' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
note: expanded from macro 'OPERATOR_LITERAL' 88 | # define OPERATOR_LITERAL(suffix) operator"" _##suffix

@aengusjiang

Copy link
Copy Markdown
Contributor Author

you mean that go line 88 when you use clang complier?
image

@aengusjiang

aengusjiang commented Aug 13, 2025 •

Copy link
Copy Markdown
Contributor Author

may this can help you
`
#if (defined(GNUC) && !defined(clang) && GNUC < 5)

define OPERATOR_LITERAL(suffix) operator"" suffix

#else

define OPERATOR_LITERAL(suffix) operator""suffix

#endif
`

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 this pull request may close these issues.

3 participants