aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-02-14 22:45:36 +0100
committerTor Egge <Tor.Egge@broadpark.no>2020-02-14 22:45:52 +0100
commit34878fd4801d94fd9a2d816bd8eb9b5f3ad05a67 (patch)
treec1be35391d2b4527bd5ad2529cc16884303d67e6
parentb173d4bd32ca845e91e1464fb6812a040025cb9b (diff)
Fix issues detected by clang 10.
-rw-r--r--eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp4
-rw-r--r--searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp2
-rw-r--r--searchlib/src/tests/aggregator/perdocexpr.cpp2
-rw-r--r--searchlib/src/tests/expression/attributenode/attribute_node_test.cpp2
-rw-r--r--storageframework/src/vespa/storageframework/generic/status/httpurlpath.cpp2
6 files changed, 7 insertions, 6 deletions
diff --git a/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp b/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp
index e2ec8d52a68..cce9838d967 100644
--- a/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp
+++ b/eval/src/vespa/eval/eval/llvm/llvm_wrapper.cpp
@@ -12,12 +12,12 @@
#include <llvm/Analysis/Passes.h>
#include <llvm/IR/DataLayout.h>
#include <llvm/Transforms/Scalar.h>
-#if LLVM_VERSION_MAJOR == 9 && defined(__clang__)
+#if LLVM_VERSION_MAJOR >= 9 && defined(__clang__)
// Avoid reference to undefined symbol llvm::cfg::Update<llvm::BasicBlock*>::dump() const
#define NDEBUG
#endif
#include <llvm/LinkAllPasses.h>
-#if LLVM_VERSION_MAJOR == 9 && defined(__clang__)
+#if LLVM_VERSION_MAJOR >= 9 && defined(__clang__)
#undef NDEBUG
#endif
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
diff --git a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
index da5a8b31671..76dcf53c51d 100644
--- a/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attributes_state_explorer/attributes_state_explorer_test.cpp
@@ -10,6 +10,7 @@
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/test/insertion_operators.h>
+#include <vespa/searchlib/attribute/singlenumericattribute.hpp>
#include <vespa/log/log.h>
LOG_SETUP("attributes_state_explorer_test");
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp b/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp
index d34ec8d05a8..bf97bdda29a 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/metrics/metrics_engine.cpp
@@ -106,7 +106,7 @@ void
doCleanAttributes(AttributeMetrics &attributes)
{
auto entries = attributes.release();
- for (const auto entry : entries) {
+ for (const auto &entry : entries) {
attributes.parent()->unregisterMetric(*entry);
}
}
diff --git a/searchlib/src/tests/aggregator/perdocexpr.cpp b/searchlib/src/tests/aggregator/perdocexpr.cpp
index 610fc58e98f..41465f991e3 100644
--- a/searchlib/src/tests/aggregator/perdocexpr.cpp
+++ b/searchlib/src/tests/aggregator/perdocexpr.cpp
@@ -1209,7 +1209,7 @@ TEST("testArithmeticOperations") {
testAdd(createScalarInt(I1), createScalarInt(I2), 3469774562ull, 3469774562ull);
testAdd(createScalarInt(I1), createScalarFloat(F2), 1793253251ull, 1793253250.767681239);
testAdd(createScalarFloat(F1), createScalarFloat(F2), 11, 10.878668839 );
- testMultiply(createScalarInt(I1), createScalarInt(I2), 3006427292488851361ull, 3006427292488851361ull);
+ testMultiply(createScalarInt(I1), createScalarInt(I2), 3006427292488851361ull, static_cast<double>(3006427292488851361ull));
testMultiply(createScalarInt(I1), createScalarFloat(F2), 17515926039ull, 1793253241.0*9.767681239);
testMultiply(createScalarFloat(F1), createScalarFloat(F2), 11, 10.8517727372816364 );
diff --git a/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp b/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp
index 503922bdb13..02d459dd0d8 100644
--- a/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp
+++ b/searchlib/src/tests/expression/attributenode/attribute_node_test.cpp
@@ -267,7 +267,7 @@ Fixture::assertBools(std::vector<bool> expVals, const vespalib::string &attribut
{
auto node = makeNode(attributeName, false, preserveAccurateTypes);
uint32_t docId = 0;
- for (const auto &expDocVal : expVals) {
+ for (const auto expDocVal : expVals) {
++docId;
node->setDocId(docId);
node->execute();
diff --git a/storageframework/src/vespa/storageframework/generic/status/httpurlpath.cpp b/storageframework/src/vespa/storageframework/generic/status/httpurlpath.cpp
index 337709cc591..10691d37b9e 100644
--- a/storageframework/src/vespa/storageframework/generic/status/httpurlpath.cpp
+++ b/storageframework/src/vespa/storageframework/generic/status/httpurlpath.cpp
@@ -77,7 +77,7 @@ HttpUrlPath::print(std::ostream& out, bool, const std::string&) const
if (!_attributes.empty()) {
out << "?";
size_t cnt = 0;
- for (const auto attr: _attributes) {
+ for (const auto &attr: _attributes) {
if (cnt++ > 0) {
out << "&";
}