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: New ---    
Severity: Affects Some People Flags: yuri: maintainer-feedback+
Priority: ---    
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 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.