diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-06 09:54:24 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-06 20:02:26 +0000 |
commit | 1435931cd6b6239b921649ead1aa1c1c9c9d2f99 (patch) | |
tree | af813209c4fbc4745b2eb55e31eff8ecd3a2c666 | |
parent | 11a234cf71fb7b2e96553c87c6a17ce680668374 (diff) |
Due to c++17 eval order in gcc 7 we need to be more careful.
From gcc 7 release notes.
"The C++17 evaluation order requirements can be selected in other modes with the -fstrong-eval-order flag, or disabled in C++17 mode with -fno-strong-eval-order."
-rw-r--r-- | document/src/vespa/document/repo/documenttyperepo.cpp | 3 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/distribution/group.cpp | 5 | ||||
-rw-r--r-- | vespalib/src/tests/stllike/asciistream_test.cpp | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp index 338cbf3bcc4..78d668a4886 100644 --- a/document/src/vespa/document/repo/documenttyperepo.cpp +++ b/document/src/vespa/document/repo/documenttyperepo.cpp @@ -384,7 +384,8 @@ void addDefaultDocument(DocumentTypeMap &type_map) { AnnotationType::UP(new AnnotationType(*annotation_types[i]))); } - type_map[data_types->doc_type->getId()] = data_types.release(); + uint32_t typeId = data_types->doc_type->getId(); + type_map[typeId] = data_types.release(); } const DataTypeRepo &lookupRepo(int32_t id, const DocumentTypeMap &type_map) { diff --git a/vdslib/src/vespa/vdslib/distribution/group.cpp b/vdslib/src/vespa/vdslib/distribution/group.cpp index b1a81c85dbb..8ad3dcb2f80 100644 --- a/vdslib/src/vespa/vdslib/distribution/group.cpp +++ b/vdslib/src/vespa/vdslib/distribution/group.cpp @@ -116,7 +116,8 @@ Group::addSubGroup(Group::UP group) "Another subgroup with same index is already added.", VESPA_STRLOC); } - _subGroups[group->getIndex()] = group.release(); + auto index = group->getIndex(); + _subGroups[index] = group.release(); } void @@ -203,4 +204,4 @@ Group::getDistributionConfigHash() const { } } -}
\ No newline at end of file +} diff --git a/vespalib/src/tests/stllike/asciistream_test.cpp b/vespalib/src/tests/stllike/asciistream_test.cpp index 63066a1bf14..958eb80392a 100644 --- a/vespalib/src/tests/stllike/asciistream_test.cpp +++ b/vespalib/src/tests/stllike/asciistream_test.cpp @@ -103,7 +103,8 @@ AsciistreamTest::testIllegalNumbers() float f(0); EXPECT_EXCEPTION(is >> f, IllegalArgumentException, "float value is outside of range '7777777777777777777777777777777777777777'"); EXPECT_EQUAL(40u, is.size()); - is << "e" << is.str(); + vespalib::string tmp = is.str(); + is << "e" << tmp; EXPECT_EQUAL(81u, is.size()); double d(0); EXPECT_EXCEPTION(is >> d, IllegalArgumentException, "double value is outside of range '7777777777777777777777777777777777777777e7777777777777777777777777777777777777777'"); |