Open ldionne opened 3 months ago
The following code is ill-formed, but we don't diagnose it:
#include <type_traits> template <> struct std::common_type<int, int> { using type = long; }; // should warn struct Foo { }; template <> struct std::common_type<Foo> { using type = int; }; // should warn template <> struct is_integral<Foo> { }; // should warn // etc...
It would be nice if Clang caught invalid specializations of std::common_type, and in fact perhaps of the other type trait classes as well.
std::common_type
Extracted from https://github.com/llvm/llvm-project/pull/99473#discussion_r1691981664.
Related: #101469 (libc++ can use this for the is_integral case to get the warning)
is_integral
The following code is ill-formed, but we don't diagnose it:
It would be nice if Clang caught invalid specializations of
std::common_type
, and in fact perhaps of the other type trait classes as well.Extracted from https://github.com/llvm/llvm-project/pull/99473#discussion_r1691981664.