Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate revertible type traits #96

Open
pgoodman opened this issue Sep 5, 2023 · 0 comments
Open

Investigate revertible type traits #96

pgoodman opened this issue Sep 5, 2023 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@pgoodman
Copy link
Member

pgoodman commented Sep 5, 2023

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.

@pgoodman pgoodman added good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant