You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IntelliSense incorrectly reports errors for valid C++23 ranges pipe operator syntax in a modern C++ project. The project is a single CMake project using C++23 with libc++ and Clang. The error occurs in any source file that uses the ranges pipe operator, despite the code compiling and running correctly.
Steps to Reproduce
Create a new C++ project using CMake
Configure the project to use C++23 with libc++ and Clang
Add the following configuration to .vscode/c_cpp_properties.json:
Hey @sean-mcmanus, thanks for taking a look at this. It is indeed a std::string_view. Here is the whole function:
std::vector<std::string> CommandLine::splitFlags(const std::string_view flags) {
std::vector<std::string> result;
for (constauto flag : flags | std::views::split(',')) {
std::string_view flagView(flag.begin(), flag.end());
auto trimmed = flagView | std::views::drop_while(isspace) | std::views::reverse | std::views::drop_while(isspace) |
std::views::reverse;
if (!trimmed.empty()) {
result.emplace_back(trimmed.begin(), trimmed.end());
}
}
return result;
}
This is the header for reference:
/** * @brief Splits a comma-separated flag list into individual flags * * Handles whitespace trimming and empty segments. * * @param flags Comma-separated flag list * @return Vector of individual flags*/
[[nodiscard]] static std::vector<std::string> splitFlags(std::string_view flags);
Let me know if you want me to provide the whole header and implementation file and/or any of the rest of my build configurations.
Environment
Bug Summary and Steps to Reproduce
Bug Summary
IntelliSense incorrectly reports errors for valid C++23 ranges pipe operator syntax in a modern C++ project. The project is a single CMake project using C++23 with libc++ and Clang. The error occurs in any source file that uses the ranges pipe operator, despite the code compiling and running correctly.
Steps to Reproduce
Create a new C++ project using CMake
Configure the project to use C++23 with libc++ and Clang
Add the following configuration to .vscode/c_cpp_properties.json:
Create a new .cpp file with the following code:
Expected behavior:
Actual behavior:
"no operator '|' matches these operands" (error 349)
Error Details
IntelliSense error message:
The code compiles and runs correctly with Clang, suggesting this is an IntelliSense limitation with C++23 ranges features.
Configuration and Logs
Other Extensions
No response
Additional context
IntelliSense error message:
The code compiles and runs correctly with Clang, suggesting this is an IntelliSense limitation with C++23 ranges features.
The text was updated successfully, but these errors were encountered: