It appears that c++20 flags are not being passed to msvc when the c++20 feature is enabled
demo.cc:
#include <compare>
void check() {
auto res = 1 <=> 2;
}
cargo.toml:
[package]
name = "rustlib"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "rustlib"
crate-type = ["staticlib"]
[dependencies]
cxx = {version = "1.0.115", features = ["c++20"]}
[build-dependencies]
cxx-build = "1.0.115"
cargo build
running: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "D:\\...\\target\\debug\\build\\rustlib-0398cc2d1afc7067\\out\\cxxbridge\\include" "-I" "D:\\...\\target\\debug\\build\\rustlib-0398cc2d1afc7067\\out\\cxxbridge\\crate" "-W4" "-FoD:\\...\\target\\debug\\build\\rustlib-0398cc2d1afc7067\\out\\src/demo.o" "-c" "src/demo.cc"
demo.cc
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\compare(12): warning STL4038: The contents of <compare> are available only with C++20 or later.
src/demo.cc(3): error C2059: syntax error: '>'
exit code: 2
It appears that c++20 flags are not being passed to msvc when the c++20 feature is enabled
demo.cc:
cargo.toml: