Skip to content

Commit 7607dd3

Browse files
committed
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++
1 parent 4a26f7e commit 7607dd3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2025-05-06 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/Attributes.R: Support C++26 via plugin
4+
15
2025-05-05 Dirk Eddelbuettel <[email protected]>
26

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

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

0 commit comments

Comments
 (0)