[all-commits] [llvm/llvm-project] 0804ca: [Clang] Explain why a type trait evaluated to fals...

cor3ntin via All-commits all-commits at lists.llvm.org
Sat May 24 01:36:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0804ca88abbfc5951be1e3f2ccb4fe7d46c3a410
      https://github.com/llvm/llvm-project/commit/0804ca88abbfc5951be1e3f2ccb4fe7d46c3a410
  Author: cor3ntin <corentinjabot at gmail.com>
  Date:   2025-05-24 (Sat, 24 May 2025)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTypeTraits.cpp
    A clang/test/SemaCXX/type-traits-unsatisfied-diags-std.cpp
    A clang/test/SemaCXX/type-traits-unsatisfied-diags.cpp
    M clang/test/SemaObjCXX/objc-weak-type-traits.mm

  Log Message:
  -----------
  [Clang] Explain why a type trait evaluated to false. (#141238)

`static_assert(std::is_xx_v<MyType>);` is a common pattern to check that
a type meets a requirement.

This patch produces diagnostics notes when such assertion fails. The
first type trait for which we provide detailed explanation is
std::is_trivially_relocatable.

We employ the same mechanisn when a type trait appears an an unsatisfied
atomic constraint.

I plan to also support `std::is_trivially_replaceable` in a follow up
PR, and hopefully, over time we can support more type traits.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list