hokein wrote:

It appears that the consensus is to avoid exposing the internal 
`__is_deducible` type trait to end-users, as there are no compelling use cases 
and it's not expected to be used in libc++. This also aligns with the approach 
taken by GCC.

Regarding implementation, the current tablegen-based mechanism doesn't offer an 
optimal solution for defining internal-only builtins. Several options:

1) Making manual changes in the `TypeTrait` structure code, as proposed by 
@AaronBallman. While feasible, this approach may be somewhat hacky and would 
require modifications in multiple places (please see the current 
implementation, which involves four locations).
2) Following the standard defining-builtin approach but emitting a diagnostic 
warning when Clang parses `__is_deducible`. This option seems to strike the 
right balance, as it provides a compromise between adherence to clang's 
standard implementation and user guidance. Additionally, it would allow for 
dedicated lit tests for this type trait.
3) Following the standard approach but omitting the type trait name in the 
`TYPE_TRAIT_2` macro, as suggested by @cor3ntin. However, this approach will 
affect components that need to print the type-trait name (e.g., AST dump, 
diagnostics).

Opinions and thoughts would be appreciated, @AaronBallman, @cor3ntin, 
@erichkeane 


https://github.com/llvm/llvm-project/pull/89358
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to