You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduced the issue to a self-contained, reproducible test case.
Description
In file included from /disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/predict.cpp:2:
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/mepo.cpp:30:19: warning: loop variable 's' creates a copy from type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, double>, void *> *>>::value_type' (aka 'const pair<const long, double>') [-Wrange-loop-construct]
for (const auto s : syms1)
^
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/mepo.cpp:30:8: note: use reference type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, double>, void *> *>>::value_type &' (aka 'const pair<const long, double> &') to prevent copying
for (const auto s : syms1)
^~~~~~~~~~~~~~
&
In file included from /disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/predict.cpp:3:
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/nbayes.cpp:66:19: warning: loop variable 'sv' creates a copy from type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, long>, void *> *>>::value_type' (aka 'const pair<const long, long>') [-Wrange-loop-construct]
for (const auto sv : sfreqh) {
^
/disk-samsung/freebsd-ports/math/lean/work/lean-3.48.0/src/library/predict/nbayes.cpp:66:8: note: use reference type 'const std::__hash_map_const_iterator<std::__hash_const_iterator<std::__hash_node<std::__hash_value_type<long, long>, void *> *>>::value_type &' (aka 'const pair<const long, long> &') to prevent copying
for (const auto sv : sfreqh) {
^~~~~~~~~~~~~~~
&
Such warnings usually mean that the code wastes some CPU cycles on unnecessary object copying.
Steps to Reproduce
regular build
Versions
lean-3.48.0
clang-14
FreeBSD 13.1
The text was updated successfully, but these errors were encountered:
Prerequisites
or feature requests.
Description
Such warnings usually mean that the code wastes some CPU cycles on unnecessary object copying.
Steps to Reproduce
regular build
Versions
lean-3.48.0
clang-14
FreeBSD 13.1
The text was updated successfully, but these errors were encountered: