arborx / ArborX

Performance-portable geometric search library
BSD 3-Clause "New" or "Revised" License
184 stars 39 forks source link

Fix return type of getIndexable in HappyTreeFriends #1163

Closed aprokop closed 1 month ago

aprokop commented 1 month ago

First push is the test to make sure CI gets the warning. Second push is the fix.

aprokop commented 1 month ago

Warning from GCC build on 0d181943c770e108ab0ce4de6c22eab158e12e71:

In file included from <snip>/test/tstIndexableGetter.cpp:14:
In file included from <snip>/src/ArborX_LinearBVH.hpp:27:
In file included from <snip>/src/details/ArborX_DetailsTreeTraversal.hpp:15:
<snip>/src/details/ArborX_DetailsHappyTreeFriends.hpp:56:12:
warning: returning reference to local temporary object [-Wreturn-stack-address]
    return bvh._indexable_getter(getValue(bvh, i));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~