[clang] [Clang] Added explanation why a is constructible evaluated to false. (PR #143309)

Shamshura Egor via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 9 09:19:33 PDT 2025


================
@@ -2159,6 +2167,26 @@ static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef,
   }
 }
 
+static void DiagnoseNonConstructibleReason(Sema &SemaRef, SourceLocation Loc,
+                                           QualType T) {
+  SemaRef.Diag(Loc, diag::note_unsatisfied_trait)
----------------
egorshamshura wrote:

Thanks for your advice. I have tried to use ```InitializationSequence::Diagnose```. However I'm dealing with some issues. 
1) ```InitializationSequence::Diagnose``` does not emit any diagnostic. It correctly returns true or false, but nothing appears in console. Although the FailureKind in ```InitializationSequence``` is defined correctly.
2) After ```InitializationSequence::Diagnose``` I can not use ```SemaRef.Diag```. Nothing is being written to the console. However I can write in ```llvm::errs``` manually.
So, can you please help me understand what I'm doing wrong? I have uploaded the latest update.

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


More information about the cfe-commits mailing list