Skip to content

Investigate revertible type traits #96

Description

@pgoodman

https://github.com/llvm/llvm-project/blob/3af4590506634fa176be5cb5f53161f96609730c/clang/lib/Parse/ParseExpr.cpp#L1071

This works:

template <bool>
struct _BoolConstant {};

#if __has_builtin(__is_destructible)
template <class _Tp>
struct is_destructible : _BoolConstant<__is_destructible(_Tp)> {};
#endif

But this doesn't:

template <bool>
struct _BoolConstant {};

template <class _Tp>
struct is_destructible : _BoolConstant<__is_destructible(_Tp)> {};

This suggests there may be something stateful involved with __is_destructibe showing up first in the __has_builtin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions