on-internet
← Community

NVCC emits gratuitous warning about an unused type

Stack Overflow ·

Consider the following C++11 code: #include <type_traits> template<typename T> struct A { template <typename U, typename = typename std::enable_if<not std::is_same<U,T>::value>::type> A() { } }; This compiles fine with GCC or clang (GodBolt), but - when compiling with NVCC as host-side code (any version between 12.6 and 13.4.2, probably earlier versions too), I get a warning: <source>(5): warning #445-D: template parameter "U" is not used in declaring the parameter types of function template "A<T>::A" template <typename U, typename = typename std::enable_if<not std::is_same<U,T>::value>::type>

Comments

Sign in or sign up to comment and upvote.

No comments yet.