Bug 244641 - benchmarks/libcelero: Fix build with clang 10.0.0
Summary: benchmarks/libcelero: Fix build with clang 10.0.0
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 244251
  Show dependency treegraph
 
Reported: 2020-03-06 18:34 UTC by Dimitry Andric
Modified: 2021-10-05 00:01 UTC (History)
1 user (show)

See Also:
yuri: maintainer-feedback+


Attachments
Fix benchmarks/libcelero build with clang 10.0.0 (967 bytes, patch)
2020-03-06 18:34 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2020-03-06 18:34:28 UTC
Created attachment 212203 [details]
Fix benchmarks/libcelero build with clang 10.0.0

As reported in bug 244251, with clang 10.0.0 the benchmarks/libcelero port runs into a -Werror warning:

/wrkdirs/usr/ports/benchmarks/libcelero/work/Celero-2.6.0/src/TestFixture.cpp:138:18: error: loop variable 'udm' of type 'const std::__1::shared_ptr<celero::UserDefinedMeasurement>' creates a copy from type 'const std::__1::shared_ptr<celero::UserDefinedMeasurement>' [-Werror,-Wrange-loop-construct]
                for(const auto udm : udms)
                               ^
/wrkdirs/usr/ports/benchmarks/libcelero/work/Celero-2.6.0/src/TestFixture.cpp:138:7: note: use reference type 'const std::__1::shared_ptr<celero::UserDefinedMeasurement> &' to prevent copying
                for(const auto udm : udms)
                    ^~~~~~~~~~~~~~~~
                               &

The fix is to add the '&' as it suggests.
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2021-10-05 00:01:02 UTC
Fixed in commit 7fa7e7ccbdd210af4d6b507cc223e9bf5ccd061d