Skip to content

Commit dcd5779

Browse files
authored
Support C++26 via plugin (closes #1380) (#1381)
* 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++ * Roll minor version and date
1 parent 4a26f7e commit dcd5779

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2025-05-06 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll micro version and date
4+
* inst/include/Rcpp/config.h: Idem
5+
6+
* R/Attributes.R: Support C++26 via plugin
7+
18
2025-05-05 Dirk Eddelbuettel <[email protected]>
29

310
* inst/tinytest/test_sugar.R: Condition four NA-related tests away on

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 1.0.14.12
4-
Date: 2025-03-31
3+
Version: 1.0.14.13
4+
Date: 2025-05-06
55
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
66
comment = c(ORCID = "0000-0001-6419-907X")),
77
person("Romain", "Francois", role = "aut",

R/Attributes.R

+7
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,13 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
560560
list(env = list(PKG_CXXFLAGS ="-std=c++23"))
561561
}
562562

563+
# built-in C++26 plugin for C++26
564+
.plugins[["cpp26"]] <- function() {
565+
if (getRversion() >= "4.5") # with recent R versions, R can decide
566+
list(env = list(USE_CXX26 = "yes"))
567+
else
568+
list(env = list(PKG_CXXFLAGS ="-std=c++26"))
569+
}
563570

564571
## built-in C++1z plugin for C++17 standard under development
565572
## note that as of Feb 2017 this is taken to be a moving target

inst/include/Rcpp/config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define RCPP_VERSION_STRING "1.0.14"
3131

3232
// the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it)
33-
#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,12)
34-
#define RCPP_DEV_VERSION_STRING "1.0.14.12"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,0,14,13)
34+
#define RCPP_DEV_VERSION_STRING "1.0.14.13"
3535

3636
#endif

0 commit comments

Comments
 (0)