[clang] [Clang] Explain why a type is not replaceable. (PR #143265)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 9 20:43:43 PDT 2025
================
@@ -1763,27 +1763,39 @@ def err_user_defined_msg_constexpr : Error<
"constant expression">;
// Type traits explanations
-def note_unsatisfied_trait : Note<"%0 is not %enum_select<TraitName>{"
- "%TriviallyRelocatable{trivially relocatable}|"
- "%TriviallyCopyable{trivially copyable}"
- "}1">;
+def note_unsatisfied_trait
+ : Note<"%0 is not %enum_select<TraitName>{"
+ "%TriviallyRelocatable{trivially relocatable}|"
+ "%Replaceable{replaceable}|"
+ "%TriviallyCopyable{trivially copyable}"
+ "}1">;
def note_unsatisfied_trait_reason
: Note<"because it "
"%enum_select<TraitNotSatisfiedReason>{"
"%Ref{is a reference type}|"
+ "%Const{is const}|"
+ "%Volatile{is volatile}|"
"%HasArcLifetime{has an ARC lifetime qualifier}|"
"%VLA{is a variably-modified type}|"
"%VBase{has a virtual base %1}|"
+ "%NotScalarOrClass{not %select{a|an array of objects of}1 scalar or "
----------------
shafik wrote:
I don't see a test for the `an array of objects` case
https://github.com/llvm/llvm-project/pull/143265
More information about the cfe-commits
mailing list