Bug 244810 - Mk/Uses/compiler.mk: Add compiler:c++20-lang
Summary: Mk/Uses/compiler.mk: Add compiler:c++20-lang
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords: feature
Depends on:
Blocks:
 
Reported: 2020-03-14 18:34 UTC by Yuri Victorovich
Modified: 2021-04-23 10:04 UTC (History)
2 users (show)

See Also:


Attachments
Mk/Uses/compiler.mk: Add compiler:c++20-lang (1.93 KB, patch)
2021-04-23 10:04 UTC, olevole
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2020-03-14 18:34:42 UTC
There compiler:c++17-lang and compiler:c++17-lang, but no compiler:c++20-lang

Some C++ features were introduced in C++20, for example std::identity, see https://en.cppreference.com/w/cpp/utility/functional/identity
Comment 1 olevole 2021-04-23 07:46:15 UTC
++, some ports (for example, latest version of clickhouse ) started using -std=c++20 code
Comment 2 olevole 2021-04-23 08:41:38 UTC
I'm not sure that this is enough:

--
--- compiler.mk.orig    2021-04-09 12:39:56.641342000 +0300
+++ compiler.mk 2021-04-23 11:00:54.440261000 +0300
@@ -8,6 +8,7 @@
 # c++11-lang:  The port needs a compiler understanding C++11
 # c++14-lang:  The port needs a compiler understanding C++14
 # c++17-lang:  The port needs a compiler understanding C++17
+# c++20-lang:  The port needs a compiler understanding C++20
 # gcc-c++11-lib:The port needs g++ compiler with a C++11 library
 # c++11-lib:   The port needs a compiler understanding C++11 and with a C++11 ready standard library
 # c11:         The port needs a compiler understanding C11
@@ -34,7 +35,7 @@
 compiler_ARGS= env
 .endif
 
-VALID_ARGS=    c++11-lib c++11-lang c++14-lang c++17-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib
+VALID_ARGS=    c++11-lib c++11-lang c++14-lang c++17-lang c++20-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib
 
 _CC_hash:=     ${CC:hash}
 _CXX_hash:=    ${CXX:hash}
@@ -51,6 +52,8 @@
 _COMPILER_ARGS+=       features c++14-lang
 .elif ${compiler_ARGS} == c++17-lang
 _COMPILER_ARGS+=       features c++17-lang
+.elif ${compiler_ARGS} == c++20-lang
+_COMPILER_ARGS+=       features c++20-lang
 .elif ${compiler_ARGS} == c11
 _COMPILER_ARGS+=       features c11
 .elif ${compiler_ARGS} == features
@@ -139,7 +142,7 @@
 .endif
 
 CSTD=  c89 c99 c11 gnu89 gnu99 gnu11
-CXXSTD=        c++98 c++0x c++11 c++14 c++17 gnu++98 gnu++11 gnu++14 gnu++17
+CXXSTD=        c++98 c++0x c++11 c++14 c++17 c++20 gnu++98 gnu++11 gnu++14 gnu++17
 
 .for std in ${CSTD} ${CXXSTD}
 _LANG=c
@@ -169,7 +172,8 @@
 .endif
 .endif
 
-.if (${_COMPILER_ARGS:Mc++17-lang} && !${COMPILER_FEATURES:Mc++17}) || \
+.if (${_COMPILER_ARGS:Mc++20-lang} && !${COMPILER_FEATURES:Mc++20}) || \
+(${_COMPILER_ARGS:Mc++17-lang} && !${COMPILER_FEATURES:Mc++17}) || \
 (${_COMPILER_ARGS:Mc++14-lang} && !${COMPILER_FEATURES:Mc++14}) || \
 (${_COMPILER_ARGS:Mc++11-lang} && !${COMPILER_FEATURES:Mc++11}) || \
 (${_COMPILER_ARGS:Mc++0x} && !${COMPILER_FEATURES:Mc++0x}) || \
--


Perhaps we should additionally explicitly indicate the dependency on the llvm clang11 here, e.g.:
--
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang11:devel/llvm11
CPP=    ${LOCALBASE}/bin/clang-cpp11
CC=     ${LOCALBASE}/bin/clang11
CXX=    ${LOCALBASE}/bin/clang++11
--
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-23 09:06:12 UTC
(In reply to olevole from comment #2)

If you could provide any diffs as attachments instead of pasted as comments, that'd be great. Thank you!
Comment 4 olevole 2021-04-23 10:04:25 UTC
Created attachment 224372 [details]
Mk/Uses/compiler.mk: Add compiler:c++20-lang