From 7607dd328fd1e44e9249e642dcda458c155a6d60 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 6 May 2025 07:23:05 -0500 Subject: [PATCH 1/2] Support C++26 Tested locally and had success with R-devel but not R-release but that may well be due to my R-release being the packaged .deb built with a more conservative g++ version. A local R 4.5.0 should also work with proper g++ or clang++ --- ChangeLog | 4 ++++ R/Attributes.R | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index efa6a87b9..1106fca95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2025-05-06 Dirk Eddelbuettel + + * R/Attributes.R: Support C++26 via plugin + 2025-05-05 Dirk Eddelbuettel * inst/tinytest/test_sugar.R: Condition four NA-related tests away on diff --git a/R/Attributes.R b/R/Attributes.R index 583fbac6f..53e9f0a61 100644 --- a/R/Attributes.R +++ b/R/Attributes.R @@ -560,6 +560,13 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { list(env = list(PKG_CXXFLAGS ="-std=c++23")) } +# built-in C++26 plugin for C++26 +.plugins[["cpp26"]] <- function() { + if (getRversion() >= "4.5") # with recent R versions, R can decide + list(env = list(USE_CXX26 = "yes")) + else + list(env = list(PKG_CXXFLAGS ="-std=c++26")) +} ## built-in C++1z plugin for C++17 standard under development ## note that as of Feb 2017 this is taken to be a moving target From f3472d1560bd65fc9fa3cde9bc3d73d4fd8ad6b1 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Tue, 6 May 2025 07:30:15 -0500 Subject: [PATCH 2/2] Roll minor version and date --- ChangeLog | 3 +++ DESCRIPTION | 4 ++-- inst/include/Rcpp/config.h | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1106fca95..ee9ffe0a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2025-05-06 Dirk Eddelbuettel + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + * R/Attributes.R: Support C++26 via plugin 2025-05-05 Dirk Eddelbuettel diff --git a/DESCRIPTION b/DESCRIPTION index 79ae115cf..d1b5f2cd1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 1.0.14.12 -Date: 2025-03-31 +Version: 1.0.14.13 +Date: 2025-05-06 Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", comment = c(ORCID = "0000-0001-6419-907X")), person("Romain", "Francois", role = "aut", diff --git a/inst/include/Rcpp/config.h b/inst/include/Rcpp/config.h index da3c5c4b6..19ca7e9e2 100644 --- a/inst/include/Rcpp/config.h +++ b/inst/include/Rcpp/config.h @@ -30,7 +30,7 @@ #define RCPP_VERSION_STRING "1.0.14" // the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it) -#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,12) -#define RCPP_DEV_VERSION_STRING "1.0.14.12" +#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,13) +#define RCPP_DEV_VERSION_STRING "1.0.14.13" #endif