https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115497

--- Comment #15 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> 
---
(In reply to Jonathan Wakely from comment #14)
> I assume clang doesn't have __is_arithmetic, __is_scalar and __is_void
> built-ins yet, because <bits/cpp_type_traits.h> also defines class templates
> with those names.

Clang has all of those
(https://github.com/llvm/llvm-project/blob/12cf0dc685a9c3adfefc3a58f0b8ed4360be8b14/clang/include/clang/Basic/TokenKinds.def#L552),
but it looks like <type_traits> happens to not use them in a way that breaks.

The specific problem with __is_pointer in <type_traits> is that it's being used
in a template argument:

    : public __bool_constant<__is_pointer(_Tp)>

... where it would be valid to parse a type. Clang's hack to treat
`__is_pointer(T)` as the builtin (after we've seen a declaration using the same
name) only applies in contexts where we know we're parsing an expression. (We
can fix this, but I think the healthier thing long-term is to treat these as
keywords everywhere.)

Reply via email to