mclow.lists added a comment.

Complete reproducer:

// Tested with with:  clang++ -std=c++14 -Wunused-function UnusedFVassily.cpp 
//
// UnusedFVassily.cpp:8:39: warning: unused function '__test' 
[-Wunused-function]
//     template <class _Up> static __two __test(...);
//                                       ^
// UnusedFVassily.cpp:9:38: warning: unused function '__test' 
[-Wunused-function]
//     template <class _Up> static char __test(typename _Up::pointer* = 0);
//                                      ^
// 2 warnings generated.

#include <type_traits>

namespace foo {

struct __two {char __lx; char __lxx;};
namespace __has_pointer_type_imp
{

  template <class _Up> static __two __test(...);
  template <class _Up> static char __test(typename _Up::pointer* = 0);

}

template <class _Tp>
struct __has_pointer_type

  : public std::integral_constant<bool, 
sizeof(__has_pointer_type_imp::__test<_Tp>(0)) == 1>

{
};

}

struct S1 {};
struct S2 { typedef void *pointer; };

int main () {
        static_assert (!foo::__has_pointer_type<S1>::value, "" );
        static_assert ( foo::__has_pointer_type<S2>::value, "" );
}


https://reviews.llvm.org/D29877



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to