interprocess icon indicating copy to clipboard operation
interprocess copied to clipboard

clang++-19 errors on segment_manager.hpp

Open eddelbuettel opened this issue 1 year ago • 0 comments

The CRAN repository (of packages for the R language) found that after the Boost 1.87.0 update, previously working now errors. (I maintain BH, a package of a large-ish subset of Boost as a header-only library, this is used fairly widely by about 335 CRAN package and a further 40 BioConductor packages. One of those, BiocParallel failed.)

We can reproduce the error on a standard Ubuntu 24.04 LTS installation with clang++-19 using one of the example programs:

$ wget -q https://raw.githubusercontent.com/boostorg/interprocess/refs/heads/develop/example/doc_managed_heap_memory.cpp 
$ clang++-19 -I'/usr/local/lib/R/site-library/BH/include'  -fpic  -Wall -O3 -pedantic -o doc_managed_heap_memory doc_managed_heap_memory.cpp 
In file included from doc_managed_heap_memory.cpp:14:
In file included from /usr/local/lib/R/site-library/BH/include/boost/interprocess/managed_heap_memory.hpp:27:
In file included from /usr/local/lib/R/site-library/BH/include/boost/interprocess/detail/managed_memory_impl.hpp:30:
/usr/local/lib/R/site-library/BH/include/boost/interprocess/segment_manager.hpp:1055:41: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
 1055 |          hdr = block_header_t::template from_first_header(reinterpret_cast<index_data_t*>((void*)((char*)buffer_ptr + front_space)));
      |                                         ^
1 error generated.
$ clang++-19 --version
Ubuntu clang version 19.1.1 (1ubuntu1~24.04.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
$ 

Note that I point into the Boost 1.87.0 subset packaged as R package BH here which BiocParallel built against all prior versions.

Adding the compiler argument permits a compilation but it would be preferable if this was not required:

$ clang++-19 -I'/usr/local/lib/R/site-library/BH/include' -Wno-missing-template-arg-list-after-template-kw -fpic  -Wall -O3 -pedantic -o doc_managed_heap_memory doc_managed_heap_memory.cpp 
$ ./doc_managed_heap_memory 
$ 

eddelbuettel avatar Dec 20 '24 13:12 eddelbuettel