-
Notifications
You must be signed in to change notification settings - Fork 340
Closed
Description
When running install.packages('testthat') with a recent Clang:
* installing *source* package ‘testthat’ ...
** this is package ‘testthat’ version ‘3.2.3’
** package ‘testthat’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C compiler: ‘Homebrew clang version 21.1.0’
using C++ compiler: ‘Homebrew clang version 21.1.0’
using SDK: ‘MacOSX15.2.sdk’
<snip>
/opt/homebrew/opt/llvm/bin/clang++ -I"/opt/homebrew/Cellar/r/4.5.1/lib/R/include" -DNDEBUG -I../inst/include -DCOMPILING_TESTTHAT -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/include -I/opt/homebrew/opt/llvm/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/tcl-tk/include -DCATCH_CONFIG_CPP11_NO_SHUFFLE -Wno-missing-template-arg-list-after-template-kw -fPIC -g -O3 -Wall -pedantic -mtune=native -pipe -c test-runner.cpp -o test-runner.o
In file included from test-runner.cpp:7:
In file included from ../inst/include/testthat.h:1:
In file included from ../inst/include/testthat/testthat.h:72:
../inst/include/testthat/vendor/catch.h:7187:18: error: no member named 'random_shuffle' in namespace 'std'
7187 | std::random_shuffle( vector.begin(), vector.end() );
| ^~~~~~~~~~~~~~
In file included from test-runner.cpp:7:
In file included from ../inst/include/testthat.h:1:
In file included from ../inst/include/testthat/testthat.h:170:
In file included from /opt/homebrew/Cellar/r/4.5.1/lib/R/include/R.h:70:
/opt/homebrew/Cellar/r/4.5.1/lib/R/include/R_ext/Boolean.h:62:36: warning: unknown warning group '-Wfixed-enum-extension', ignored [-Wunknown-warning-option]
62 | # pragma clang diagnostic ignored "-Wfixed-enum-extension"
| ^
1 warning and 1 error generated.
make: *** [test-runner.o] Error 1
ERROR: compilation failed for package ‘testthat’
* removing ‘/opt/homebrew/lib/R/4.5/site-library/testthat’
According to this, std::random_shuffle was deprecated in C++14 and removed in C++17, and C++17 is the default standard for Clang versions 16 and higher.
I can make this build by forcing C++14 in my Makevars file, but it would be great if this can be fixed at the source.
Metadata
Metadata
Assignees
Labels
No labels