Clang 10 throws the following error:
loop variable 'addr_range' of type 'const AddrRange' creates a
copy from type 'const AddrRange' [-Werror,-Wrange-loop-construct]
note: use reference type 'const AddrRange &' to prevent copying
Issue introduced by
c7fabb979c09864ab47ae848381d6797b45a4cc6.
Change-Id: I43e8d613eb5069d5ce9cb12ddec18cba0a3847f6
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38495
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
for (auto abs_cntrl : params().downstream_destinations) {
MachineID mid = abs_cntrl->getMachineID();
const AddrRangeList &ranges = abs_cntrl->getAddrRanges();
- for (const auto addr_range : ranges) {
+ for (const auto &addr_range : ranges) {
auto i = downstreamAddrMap.intersects(addr_range);
if (i == downstreamAddrMap.end()) {
i = downstreamAddrMap.insert(addr_range, AddrMapEntry());