Closed bfstree closed 8 months ago
O_O that is a crazy bug. Thanks for doing the legwork to look into the underlying issue! I don't know when I'll get time to action this, but in the short-term there's a workaround you can try:
In an old version of GCC there was a bug on those branches (relating to detecting the return type of a lambda in a template), and I added a fallback escape hatch that just happens to disable the problematic code causing your issue:
#define TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN 1
#define TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN_ACKNOWLEDGED 1
#include "toml.hpp"
It means you can't use a bool (or bool-convertible) type returning false
to early exit from a for_each()
method, but it might at least unblock you. (See #197 if you want some more context for this workaround.)
This workaround works for now. Now, I can use toml instead of complex command line arguments and export runtime statistics, which simplifies and integrates well into the entire development process. Thank you!
Environment
toml++ version and/or commit hash:
toml++ v3.4.0
Compiler:
nvcc v12.1 and v11.6
C++ standard mode:
-std=c++20 and c++17
Target arch:
x86_64
Library configuration overrides:
None
Relevant compilation flags:
--extended-lambda -std=c++17 or c++20
Describe the bug
Does not compile with error:
Steps to reproduce (or a small repro code sample)
Additional information
Compile the above
main.cu
file usingnvcc --extended-lambda -std=c++17 main.cu
c++17 and c++20 both produces the same error, also with or without--extended-lambda
There is some documentation here: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#extended-lambdas and: https://stackoverflow.com/questions/74349712/cuda-11-fails-to-compile-due-to-type-traits-in-standard-library-when-using-exten