diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md index e8a7b2014e..a45306d006 100644 --- a/.gitlab/issue_templates/bug.md +++ b/.gitlab/issue_templates/bug.md @@ -49,7 +49,7 @@ " << ltable1[key] << nl; + } } Info<< "\nEnd\n" << endl; diff --git a/applications/test/Hashing2/hashingTests b/applications/test/Hashing2/hashingTests index 1d7862f347..76ae87fadf 100644 --- a/applications/test/Hashing2/hashingTests +++ b/applications/test/Hashing2/hashingTests @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2212 | +| \\ / O peration | Version: v2306 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/applications/test/IOField/Test-IOField.C b/applications/test/IOField/Test-IOField.C index 478d917359..d921dc09b0 100644 --- a/applications/test/IOField/Test-IOField.C +++ b/applications/test/IOField/Test-IOField.C @@ -46,35 +46,39 @@ using namespace Foam; template void doWrite(const IOobject& io, const label sz) { + const bool writeOnProc = (sz > 0); + IOField fld(io, sz); forAll(fld, i) { fld[i] = i + 1000.25 + (0.25 * i); } Pout<< "writing:" << fld << endl; - fld.write(sz > 0); + fld.write(writeOnProc); } template<> void doWrite(const IOobject& io, const label sz) { + const bool writeOnProc = (sz > 0); + IOField fld(io, sz); forAll(fld, i) { fld[i] = i % 2; } Pout<< "writing:" << fld << endl; - fld.write(sz > 0); + fld.write(writeOnProc); } template void doRead(const IOobject& io, const label sz) { - bool valid = (sz > 0); - Pout<< " valid:" << valid << endl; - IOField fld(io, valid); + const bool readOnProc = (sz > 0); + Pout<< " readOnProc:" << readOnProc << endl; + IOField fld(io, readOnProc); Pout<< " wanted:" << sz << " actually read:" << fld.size() << endl; if (fld.size() != sz) diff --git a/applications/test/IOobjectList/Test-IOobjectList.C b/applications/test/IOobjectList/Test-IOobjectList.C index 2e1e261a2f..5a74e1adfd 100644 --- a/applications/test/IOobjectList/Test-IOobjectList.C +++ b/applications/test/IOobjectList/Test-IOobjectList.C @@ -334,7 +334,7 @@ int main(int argc, char *argv[]) Info<< "==target==" << nl; reportDetail(objects); Info<< "==source==" << nl; reportDetail(other); - objects.merge(std::move(other)); + objects.merge(other); Info<< nl << "After merge" << nl; Info<< "==target==" << nl; reportDetail(objects); diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index 63ef615003..03e77dcfef 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2021 OpenCFD Ltd. + Copyright (C) 2017-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,7 +81,7 @@ namespace ListPolicy { // Override on a per-type basis -template<> struct short_length : std::integral_constant {}; +template<> struct short_length : std::integral_constant {}; } // End namespace ListPolicy } // End namespace Detail @@ -365,6 +365,12 @@ int main(int argc, char *argv[]) Info<<"assigned identity in range:" << subset << "=> " << flatOutput(longLabelList) << nl; + // Assign values in iterator range + std::iota(longLabelList.begin(15), longLabelList.begin(50), 115); + + Info<<"assigned values in iterator range " + << "=> " << flatOutput(longLabelList) << nl; + labelList someList(identity(24)); longLabelList.slice(subset) = @@ -410,8 +416,20 @@ int main(int argc, char *argv[]) longLabelList.slice({5,-5}) = 42; longLabelList.slice({21,100}) = 42; - //Good: does not compile - longLabelList.slice(labelRange(20,50)) = constLabelList; + #if 0 + // Compiles, but is runtime abort! + const bool oldThrowingError = FatalError.throwing(true); + try + { + longLabelList.slice(labelRange(20,50)) = constLabelList; + } + catch (const Foam::error& err) + { + Info<< "Caught FatalError " + << err << nl << endl; + } + FatalError.throwing(oldThrowingError); + #endif //Good: does not compile // longLabelList[labelRange(20,50)] = fixedLabelList; diff --git a/applications/test/ListOps/Test-ListOps.C b/applications/test/ListOps/Test-ListOps.C index e3db28c7ff..8fdfaf9db5 100644 --- a/applications/test/ListOps/Test-ListOps.C +++ b/applications/test/ListOps/Test-ListOps.C @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) << IndirectList