llvm/llvm-project

[Clang] Explain satisfaction failure for more type traits

开放

#141,911 创建于 2025年5月29日

 (20 条评论) (0 个反应) (0 位负责人)C++ (10,782 个派生)batch import
clang:diagnosticsclang:frontendgood first issue

仓库指标

星标
 (26,378 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Last week, we added the scaffolding for clang to explain why a standard type trait is not satisfied - when used either in a static_assert or as atomic constraint, in Sema::DiagnoseTypeTraitDetails (#141238)

https://gcc.godbolt.org/z/xb7PcxzTx

So far, this has only been done for std::is_trivially_relocatable.

There are plenty of type traits that could benefit from additional diagnostics https://eel.is/c++draft/type.traits#meta.type.synop

I figure adding support for more type traits (one at a time!) could be a good first issue, and it's always nice to improve our diagnostics.

贡献者指南