This is an archive of the discontinued LLVM Phabricator instance.

[driver] [cl] Add/fix c++17/c++latest
ClosedPublic

Authored by daxpedda on Sep 21 2017, 1:36 AM.

Details

Summary

Current "/std:c++latest" adds "-std=c++17", VS has its own "/std:c++17" for that now.

This is my first commit by the way, please tell me if there is anything I can do to improve.
Thanks.

Diff Detail

Repository
rL LLVM

Event Timeline

daxpedda created this revision.Sep 21 2017, 1:36 AM
daxpedda updated this revision to Diff 116154.Sep 21 2017, 2:36 AM

Discovered that these flags were tested and added new test.

malcolm.parsons edited the summary of this revision. (Show Details)Sep 21 2017, 3:04 AM

LGTM

we should probably set c++17 as the default over c++14 as part of this change.
given that everything seems in order for c++17 bar P0522R0 so this looks like the change should be good.
adding @rnk to confirm.

@daxpedda do you have commit access?

test/Driver/cl-options.c
514 ↗(On Diff #116154)

We should probably change the default to c++17 as part of this commit.

According to this the default is still c++14.
I do not have commit access, I would prefer if somebody else commits this in my stead.

test/Driver/cl-options.c
514 ↗(On Diff #116154)

According to this the default is still c++14.

martell accepted this revision.Sep 21 2017, 8:16 AM

It seems that msvc enabled some c++17 features when in c++14 mode and they left them enabled because projects became dependant on them.
switching to c++17 as the default and removing the c++17 features from c++14 mode seems like the correct thing to do here even if MS still use c++14 as their default.
That should be part of a different patch though because a discussion needs to be had on that issue.

LGTM as is.
Thanks for the contribution.

This revision is now accepted and ready to land.Sep 21 2017, 8:16 AM
rnk accepted this revision.Oct 3 2017, 9:19 AM

Sorry for the delay, thank you, this looks good! @martell, do you mind landing this?

This revision was automatically updated to reflect the committed changes.

Landed, @rnk I missed this message in my travels from Ireland back to Mountain View.
Just catching up with everything now :)

martell added inline comments.Oct 15 2017, 11:03 AM
cfe/trunk/test/Driver/cl-options.c
524

This was incorrect, it should have been STDCXX17.
I fixed this is rL315868