Some functions and templates are treated as __host__ __device__ even when they don't have explicitly specified target attributes.
What's worse, this treatment may change depending on command line options (-fno-cuda-host-device-constexpr) or #pragma clang force_cuda_host_device.
Combined with strict checking for matching function target that comes with D25809, it makes it hard to write code which would explicitly instantiate or specialize some functions regardless of pragmas or command line options in effect.
This patch changes the way we match target attributes of base template vs attributes used in explicit instantiation or specialization so that only explicitly specified attributes are considered.
@tra Sorry for touching such an old ticket - but cppcheck is warning that we are using a boolean result in a bitwise expression - I'm assuming this should be: