From a02e3f90f7885909e078ecff7baa77830f1afbd3 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Fri, 29 Sep 2023 14:47:26 +0200 Subject: Add missing includes, avoid shadow warning and skip including file not present in llvm 17. Issues detected when compiling with clang++ 17 / libc++ 17 / llvm 17. --- eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp | 2 ++ eval/src/vespa/eval/eval/tensor_function.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'eval') diff --git a/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp b/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp index 3fafb8f8b18..d0db56f3433 100644 --- a/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp +++ b/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp @@ -14,7 +14,9 @@ #include #include #include +#if LLVM_VERSION_MAJOR < 17 #include +#endif #include #include #include diff --git a/eval/src/vespa/eval/eval/tensor_function.cpp b/eval/src/vespa/eval/eval/tensor_function.cpp index 97590322a50..7bef6d2d880 100644 --- a/eval/src/vespa/eval/eval/tensor_function.cpp +++ b/eval/src/vespa/eval/eval/tensor_function.cpp @@ -350,12 +350,12 @@ Peek::make_spec() const // the value peeked is child 0, so // children (for label computation) in spec start at 1: size_t child_idx = 1; - for (const auto & [dim_name, label_or_child] : map()) { + for (const auto & [outer_dim_name, label_or_child] : map()) { std::visit(vespalib::overload { - [&,&dim_name = dim_name](const TensorSpec::Label &label) { + [&,&dim_name = outer_dim_name](const TensorSpec::Label &label) { generic_spec.emplace(dim_name, label); }, - [&,&dim_name = dim_name](const TensorFunction::Child &) { + [&,&dim_name = outer_dim_name](const TensorFunction::Child &) { generic_spec.emplace(dim_name, child_idx++); } }, label_or_child); -- cgit v1.2.3