[PATCH] D29877: Warn about unused static file scope function template declarations.

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 11 08:07:11 PDT 2017


mclow.lists added a comment.

The following idiom for detecting member typedefs now throws an warning:

  struct __two {char __lx; char __lxx;};
  
  namespace __has_pointer_type_imp
  {
      template <class _Up> __two __test(...);
      template <class _Up> char __test(typename _Up::pointer* = 0);
  }
  
  template <class _Tp>
  struct __has_pointer_type
      : public integral_constant<bool, sizeof(__has_pointer_type_imp::__test<_Tp>(0)) == 1>
  {
  };

Neither function named `__test` is unused; but clang now claims that they are.
Libc++ no longer builds when you have "warnings as errors" enabled.


https://reviews.llvm.org/D29877





More information about the cfe-commits mailing list