Created attachment 186489 [details]
Add compiler:c++17-lang option and c++17 language standard to compiler.mk
Now that clang 5.0 is out, it's possible to start using C++17 features. The attached patch adds support for:
including building clang 5.0 from source if a new enough clang is not available (copying the existing C++14 support).
I'd say, compiler.mk should allow using clang50 in other cases too -- such as via the DEFAULT_VERSIONS-mechanism or simply when clang50 is already installed (and 40 is not).
Currently, the compiler:c++14-lang flag will add clang40 dependency unconditionally -- even if clang50 is already present instead.
Created attachment 194098 [details]
Updated patch for Mk/Uses/compiler.mk
I'm attaching an updated patch to Mk/Uses/compiler.mk for this, using the system compiler if it supports c++17 or llvm60 if it doesn't.
One other thing was adding gnu++14 and gnu++17 to CXXSTD, as those were missing for some reason. I'm not sure if they were actually needed, though.
It would be nice to get this into the tree sooner rather than later, as I'm wanting to update the x11-toolkits/scintilla port and it uses C++17 and refuses to compile with the FreeBSD 11.1 clang 4.0 compiler.
Please remind me when this is committed, to update the Porter's Handbook.
(In reply to Mark Linimon from comment #3)
> Please remind me when this is committed, to update the Porter's Handbook.
Mmm, I usually run a git diff every once in a while on Mk/Uses to make sure I add changes I missed to the handbook. I have not done it in a while though. There is a rev number at the top of the uses/chapter.xml saying when was the last time it was all believed to be sync'ed.
A commit references this bug:
Date: Mon Jun 11 12:39:04 UTC 2018
New revision: 472188
Add support for USES=compiler:c++17-lang
Submitted by: Naram Qashat
With hat: portmgr
Patch committed, thanks!