-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
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.
Extracted from #99473 (comment).
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer