|
31 | 31 | #include <utf8/unchecked.h> |
32 | 32 |
|
33 | 33 | #include <algorithm> |
| 34 | +#include <array> |
34 | 35 | #include <cassert> |
35 | 36 | #include <format> |
36 | 37 | #include <forward_list> |
@@ -1019,8 +1020,9 @@ struct Preprocessor::Private { |
1019 | 1020 | Resolve(const Resolve &other) = delete; |
1020 | 1021 | auto operator=(const Resolve &other) -> Resolve & = delete; |
1021 | 1022 |
|
1022 | | - Resolve(const Private *d, bool next) |
1023 | | - : d(d), wantNextInlude(next), currentPaths{{d->currentPath_}} {} |
| 1023 | + Resolve(const Private *d, bool next) : d(d), wantNextInlude(next) { |
| 1024 | + currentPaths[0] = d->currentPath_.string(); |
| 1025 | + } |
1024 | 1026 |
|
1025 | 1027 | using SearchPaths = std::vector<std::span<const std::string>>; |
1026 | 1028 |
|
@@ -1050,15 +1052,15 @@ struct Preprocessor::Private { |
1050 | 1052 |
|
1051 | 1053 | [[nodiscard]] auto userHeaderSearchPaths() -> SearchPaths { |
1052 | 1054 | std::vector<std::span<const std::string>> paths; |
1053 | | - paths.push_back(currentPaths); |
1054 | | - paths.push_back(d->quoteIncludePaths_); |
1055 | | - paths.push_back(d->systemIncludePaths_); |
| 1055 | + paths.push_back(std::span<const std::string>(currentPaths)); |
| 1056 | + paths.push_back(std::span<const std::string>(d->quoteIncludePaths_)); |
| 1057 | + paths.push_back(std::span<const std::string>(d->systemIncludePaths_)); |
1056 | 1058 | return paths; |
1057 | 1059 | } |
1058 | 1060 |
|
1059 | 1061 | [[nodiscard]] auto systemHeaderSearchPaths() -> SearchPaths { |
1060 | 1062 | std::vector<std::span<const std::string>> paths; |
1061 | | - paths.push_back(d->systemIncludePaths_); |
| 1063 | + paths.push_back(std::span<const std::string>(d->systemIncludePaths_)); |
1062 | 1064 | return paths; |
1063 | 1065 | } |
1064 | 1066 |
|
|
0 commit comments