[clang] [clang] CTAD: implement the missing IsDeducible constraint for alias templates (PR #89358)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 05:00:19 PDT 2024


cor3ntin wrote:

> > > This approach is doable technically, but it feels hacky and fragile. What if we emit an error (or warning) diagnostic and reject the code when we parse the __is_deducible type trait?
> > 
> > 
> > Why do you think it is fragile? I think a comment around `BTT_IsDeducible` would take care of that
> 
> This is not a single-place change, we have to duplicate the `BTT_IsDeducible` manual change for at least 4 places:
> 
> * https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/TypeTraits.h#L28
> * https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/TypeTraits.cpp#L21
> * https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/TypeTraits.cpp#L30
> * https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/TypeTraits.cpp#L61

Something like that seem to be fine

```cpp
// IsDeducible is only used internally by clang and is not exposed to source code
TYPE_TRAIT_2(/**/, IsDeducible, KEYCXX)
```

https://github.com/llvm/llvm-project/pull/89358


More information about the cfe-commits mailing list