[PATCH] D122766: [clang] Use forward slash as the path separator for Windows in __FILE__, __builtin_FILE(), and std::source_location

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 5 07:18:12 PDT 2022

aaron.ballman added a comment.

In D122766#3419303 <https://reviews.llvm.org/D122766#3419303>, @hans wrote:

> Maybe Martin or Aaron have opinions here too?

Naively, this seems wrong to me. Yes, Windows sometimes allows you to use forward slashes, but that is not the path separator which Windows users are most often presented with in terms of documentation, screen shots, presentation in Explorer, etc. My feeling is that the default behavior on Windows needs to be to use backslashes and not forward slashes. Having an option to canonicalize in the other direction would be reasonable, as does differing what the default is based on the target.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list