mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 11:07:10 +01:00
[vcpkg] Fix gcc-9 warning (#7816)
* drop one usage of span in export. Span is not appropriate for rvalues * Add back reference * Fix @ubsan 's comments
This commit is contained in:
parent
34a26540b1
commit
94ef325828
@ -339,12 +339,13 @@ namespace vcpkg::Export
|
|||||||
|
|
||||||
struct OptionPair
|
struct OptionPair
|
||||||
{
|
{
|
||||||
const std::string& name;
|
const StringLiteral& name;
|
||||||
Optional<std::string>& out_opt;
|
Optional<std::string>& out_opt;
|
||||||
};
|
};
|
||||||
const auto options_implies =
|
const auto options_implies = [&](const StringLiteral& main_opt_name,
|
||||||
[&](const std::string& main_opt_name, bool main_opt, Span<const OptionPair> implying_opts) {
|
bool is_main_opt,
|
||||||
if (main_opt)
|
const std::initializer_list<OptionPair>& implying_opts) {
|
||||||
|
if (is_main_opt)
|
||||||
{
|
{
|
||||||
for (auto&& opt : implying_opts)
|
for (auto&& opt : implying_opts)
|
||||||
opt.out_opt = maybe_lookup(options.settings, opt.name);
|
opt.out_opt = maybe_lookup(options.settings, opt.name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user