[clang] [Driver] Fix detection of libc++ with empty sysroot. (PR #66947)

Shoaib Meenai via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 13:30:19 PDT 2023


smeenai wrote:

Sorry about the breakage.

The `sys::path::append` behavior here is surprising. I think it'd be better to change the computation of `SysRoot` in the function above (line 3102, which I can't comment because of GitHub, sigh) to default to `llvm::sys::path::get_separator()` if it's empty, to handle Windows slashes as well as be less confusing to read.

This is tricky to test because it requires no sysroot to be passed, but we might be able to do so with a VFS overlay. I'm okay adding the test afterwards though so we get the breakage fixed first, and I can also look into the test myself if you'd like.

https://github.com/llvm/llvm-project/pull/66947


More information about the cfe-commits mailing list