Skip to content

__is_pointer used both as a trait and an identifier seems inconsistent #95598

@pinskia

Description

@pinskia

Take:


template<typename _Tp, bool _IsPtr = __is_pointer(_Tp)>
  struct __is_pointer {};

template<typename _Tp>
inline bool t = __is_pointer(_Tp); // is accepted

template<bool>
struct ts{};

template<typename _Tp>
  struct is_pointer : ts<__is_pointer(_Tp)> {}; // is rejected

int tt = t<int>;

I would have expected the variable template t would have been rejected the same way as the template argument for the base class is_pointer being rejected but it is inconsistent here.

This shows up now in libstdc++'s headers (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115497).

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions