@@ -2894,8 +2894,7 @@ version 8) @option{-std=f2018} in @code{PKG_FFLAGS} or
28942894(but Fortran 95 prior to @command{gfortran}@tie{}8) with non-standard
28952895extensions. The other compilers in current use (@I{LLVM}'s
28962896@command{flang} (called @command{flang-new} before version 20) and Intel's
2897- @command{ifx}) default to Fortran 2018@footnote{but was said to have
2898- complete support only from version 2023.0.0.}.
2897+ @command{ifx}) default to Fortran 2018.
28992898
29002899It is good practice to describe a Fortran version requirement in
29012900@file{DESCRIPTION}'s @samp{SystemRequirements} field. Note that this is
@@ -2952,8 +2951,7 @@ define a module of the same name in multiple source files.
29522951@subsection Using C++ code
29532952
29542953@R{} can be built without a C++ compiler although one is available (but
2955- not necessarily installed) on all known @R{} platforms. As from @R{}
2956- 4.0.0 a C++ compiler will be selected only if it conforms to the 2011
2954+ not necessarily installed) on all known @R{} platforms.
29572955standard (`C++11'). A minor update@footnote{Some changes are linked
29582956from
29592957@uref{https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations}:
@@ -3007,40 +3005,24 @@ standards list deprecated and removed (and undeprecated) features.
30073005
30083006For maximal portability a package should specify the standard it
30093007requires for code in its @file{src} directory by including something
3010- like @samp{C++14 } in the @samp{SystemRequirements} field of the
3008+ like @samp{C++23 } in the @samp{SystemRequirements} field of the
30113009@file{DESCRIPTION} file, e.g.
30123010
30133011@example
3014- SystemRequirements: C++14
3012+ SystemRequirements: C++23
30153013@end example
30163014@noindent
30173015If it has a @file{Makevars} file (or @file{Makevars.win} or
30183016@file{Makevars.ucrt} on Windows) this should include the line
30193017@example
3020- CXX_STD = CXX14
3018+ CXX_STD = CXX23
30213019@end example
3022- @noindent
3023- On the other hand, specifying C++11@footnote{Often historically
3024- used to mean `not C++98'} when the code is valid under C++14 or C++17
3025- reduces future portability.
30263020
3027- Code needing C++14 or later features can check for their presence @emph{via}
3021+ Code needing C++20 or later features can check for their presence @emph{via}
30283022`SD-6 feature tests'@footnote{See
30293023@uref{https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations}
30303024or
3031- @uref{https://en.cppreference.com/w/cpp/experimental/feature_test.html}.
3032- It seems a reasonable assumption that any compiler promising some C++14
3033- conformance will provide these---e.g.@: @command{g++} 4.9.x did but
3034- 4.8.5 did not.}. Such a check could be
3035-
3036- @example
3037- #include <memory> // header where this is defined
3038- #if defined(__cpp_lib_make_unique) && (__cpp_lib_make_unique >= 201304)
3039- using std::make_unique;
3040- #else
3041- // your emulation
3042- #endif
3043- @end example
3025+ @uref{https://en.cppreference.com/w/cpp/experimental/feature_test.html}.}
30443026
30453027@c Ubuntu LTS releases now have 10 years of support even if announced
30463028@c with 8 years.
@@ -3055,7 +3037,7 @@ using std::make_unique;
30553037@c RHEL 8 (8.x, 9.x available. full support 2024-05 + 8 more years)
30563038@c RHEL 9 (11.x available, full support 2027-05 + 8 more years)
30573039
3058- C++17, C++ 20, C++23 and C++26 (from @R{} 4.5.0) can be specified in an
3040+ C++20, C++23 and C++26 (from @R{} 4.5.0) can be specified in an
30593041analogous way.
30603042
30613043Note that C++17 or later `support' does not mean complete support: use
@@ -3116,25 +3098,25 @@ and @command{g++} 11--15 to C++17.
31163098For a package with a @file{src/Makefile} (or a Windows analogue),
31173099a non-default C++ compiler can be selected by including something like
31183100@example
3119- CXX14 = `"$@{R_HOME@}/bin/R" CMD config CXX14 `
3120- CXX14STD = `"$@{R_HOME@}/bin/R" CMD config CXX14STD `
3121- CXX = $@{CXX14 @} $@{CXX14STD @}
3122- CXXFLAGS = `"$@{R_HOME@}/bin/R" CMD config CXX14FLAGS `
3123- CXXPICFLAGS = `"$@{R_HOME@}/bin/R" CMD config CXX14PICFLAGS `
3124- SHLIB_LD = "$@{R_HOME@}/bin/R" CMD config SHLIB_CXX14LD `
3125- SHLIB_LDFLAGS = "$@{R_HOME@}/bin/R" CMD config SHLIB_CXX14LDFLAGS `
3101+ CXX20 = `"$@{R_HOME@}/bin/R" CMD config CXX20 `
3102+ CXX20STD = `"$@{R_HOME@}/bin/R" CMD config CXX20STD `
3103+ CXX = $@{CXX20 @} $@{CXX20STD @}
3104+ CXXFLAGS = `"$@{R_HOME@}/bin/R" CMD config CXX20FLAGS `
3105+ CXXPICFLAGS = `"$@{R_HOME@}/bin/R" CMD config CXX20PICFLAGS `
3106+ SHLIB_LD = "$@{R_HOME@}/bin/R" CMD config SHLIB_CXX20LD `
3107+ SHLIB_LDFLAGS = "$@{R_HOME@}/bin/R" CMD config SHLIB_CXX20LDFLAGS `
31263108@end example
31273109@noindent
31283110and ensuring these values are used in relevant compilations, after
31293111checking they are non-empty. A common use of @file{src/Makefile} is to
31303112compile an executable, when likely something like (for example for
3131- C++14 )
3113+ C++20 )
31323114@example
3133- if test -z "$CXX14 "; then
3134- AC_MSG_ERROR([No C++14 compiler is available])
3115+ if test -z "$CXX20 "; then
3116+ AC_MSG_ERROR([No C++20 compiler is available])
31353117fi
3136- CXX = $@{CXX14 @} $@{CXX14STD @}
3137- CXXFLAGS = $@{CXX14FLAGS @}
3118+ CXX = $@{CXX20 @} $@{CXX20STD @}
3119+ CXXFLAGS = $@{CXX20FLAGS @}
31383120@end example
31393121@noindent
31403122suffices.
0 commit comments