Bug 244641

Summary: benchmarks/libcelero: Fix build with clang 10.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: diizzy
Priority: --- Flags: yuri: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 244251    
Attachments:
Description Flags
Fix benchmarks/libcelero build with clang 10.0.0 none

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