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

add travis task : compile and test under C++17 #2241

Closed
wants to merge 2 commits into from

Conversation

dota17
Copy link
Contributor

@dota17 dota17 commented Jul 6, 2020

From #2213, we could know that JSON_HAS_CPP_17 is false in all travis jobs.
Thus, we should add a task to compile and test under CXX17.

@dota17 dota17 requested a review from nlohmann as a code owner July 6, 2020 03:38
@coveralls
Copy link

coveralls commented Jul 6, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 6a22533 on dota17:travis-task-cxx17 into eb7376b on nlohmann:develop.

.travis.yml Outdated Show resolved Hide resolved
@@ -218,6 +218,17 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build']

- os: linux
Copy link
Owner

Choose a reason for hiding this comment

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

We already have a test case above that sets CXXFLAGS=-std=c++2a. Maybe this can be reused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, It seems that CXXFLAGS=-std=c++1z didn't work under c++17.

Copy link
Contributor

Choose a reason for hiding this comment

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

CXXFLAGS=-std... is overriden by compile feature cxx_std_11 in top-level CMakeLists.txt (and by CMAKE_CXX_STANDARD, if it is present; see comment in #2117)

.travis.yml Show resolved Hide resolved
@dota17 dota17 closed this Jul 14, 2020
@dota17 dota17 reopened this Jul 14, 2020
@dota17
Copy link
Contributor Author

dota17 commented Jul 14, 2020

Reopening.
I've made a little investigation.
In GCC, the -std= command-line option have C++98, C++11, C++14, C++17, C++2a, so c++2a is different from c++17.
In Clang, the same option are the same, but use -std=c++1y in Clang 3.4 and earlier.

@dota17
Copy link
Contributor Author

dota17 commented Jul 14, 2020

At the same time, I think we should update Ubuntu distribution in .travis.yml, because Precise and Trusty are EOL by Canonial.

@nlohmann
Copy link
Owner

At the same time, I think we should update Ubuntu distribution in .travis.yml, because Precise and Trusty are EOL by Canonial.

As long as they are supported by Travis, I am fine with the working setup. I am afraid that the CI breaks if we are moving to a newer version.

@stale
Copy link

stale bot commented Aug 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated and removed state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated labels Aug 16, 2020
@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Sep 20, 2020
@stale stale bot closed this Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants