https://github.com/egorshamshura updated 
https://github.com/llvm/llvm-project/pull/144220

>From 30935f3d8a910646d50f27202611deebfbae95bf Mon Sep 17 00:00:00 2001
From: Shamshura Egor <shamshurae...@gmail.com>
Date: Fri, 13 Jun 2025 19:48:52 +0000
Subject: [PATCH 1/6] Revert "Revert "[Clang] Added explanation why
 `is_constructible` evaluated to false. " (#144127)"

This reverts commit 90d98a38b273f5d62424a3815447675860947927.
---
 .../clang/Basic/DiagnosticSemaKinds.td        |  8 ++-
 clang/lib/Sema/SemaTypeTraits.cpp             | 71 ++++++++++++++++++-
 clang/test/CXX/drs/cwg18xx.cpp                |  3 +-
 ...overload-resolution-deferred-templates.cpp | 19 +++--
 .../type-traits-unsatisfied-diags-std.cpp     | 66 +++++++++++++++++
 .../SemaCXX/type-traits-unsatisfied-diags.cpp | 62 ++++++++++++++++
 6 files changed, 219 insertions(+), 10 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td 
b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 8fe7ad6138aa0..95d24e9f1e6b5 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1767,7 +1767,8 @@ def note_unsatisfied_trait
     : Note<"%0 is not %enum_select<TraitName>{"
            "%TriviallyRelocatable{trivially relocatable}|"
            "%Replaceable{replaceable}|"
-           "%TriviallyCopyable{trivially copyable}"
+           "%TriviallyCopyable{trivially copyable}|"
+           "%Constructible{constructible with provided types}"
            "}1">;
 
 def note_unsatisfied_trait_reason
@@ -1797,7 +1798,10 @@ def note_unsatisfied_trait_reason
            "%DeletedAssign{has a deleted %select{copy|move}1 "
            "assignment operator}|"
            "%UnionWithUserDeclaredSMF{is a union with a user-declared "
-           "%sub{select_special_member_kind}1}"
+           "%sub{select_special_member_kind}1}|"
+           "%FunctionType{is a function type}|"
+           "%CVVoidType{is a cv void type}|"
+           "%IncompleteArrayType{is an incomplete array type}"
            "}0">;
 
 def warn_consteval_if_always_true : Warning<
diff --git a/clang/lib/Sema/SemaTypeTraits.cpp 
b/clang/lib/Sema/SemaTypeTraits.cpp
index 1738ab4466001..22c690bedc1ed 100644
--- a/clang/lib/Sema/SemaTypeTraits.cpp
+++ b/clang/lib/Sema/SemaTypeTraits.cpp
@@ -11,6 +11,7 @@
 
//===----------------------------------------------------------------------===//
 
 #include "clang/AST/DeclCXX.h"
+#include "clang/AST/TemplateBase.h"
 #include "clang/AST/Type.h"
 #include "clang/Basic/DiagnosticParse.h"
 #include "clang/Basic/DiagnosticSema.h"
@@ -1947,6 +1948,7 @@ static std::optional<TypeTrait> 
StdNameToTypeTrait(StringRef Name) {
             TypeTrait::UTT_IsCppTriviallyRelocatable)
       .Case("is_replaceable", TypeTrait::UTT_IsReplaceable)
       .Case("is_trivially_copyable", TypeTrait::UTT_IsTriviallyCopyable)
+      .Case("is_constructible", TypeTrait::TT_IsConstructible)
       .Default(std::nullopt);
 }
 
@@ -1983,8 +1985,16 @@ static ExtractedTypeTraitInfo 
ExtractTypeTraitFromExpression(const Expr *E) {
     Trait = StdNameToTypeTrait(Name);
     if (!Trait)
       return std::nullopt;
-    for (const auto &Arg : VD->getTemplateArgs().asArray())
-      Args.push_back(Arg.getAsType());
+    for (const auto &Arg : VD->getTemplateArgs().asArray()) {
+      if (Arg.getKind() == TemplateArgument::ArgKind::Pack) {
+        for (const auto &InnerArg : Arg.pack_elements())
+          Args.push_back(InnerArg.getAsType());
+      } else if (Arg.getKind() == TemplateArgument::ArgKind::Type) {
+        Args.push_back(Arg.getAsType());
+      } else {
+        llvm_unreachable("Unexpected kind");
+      }
+    }
     return {{Trait.value(), std::move(Args)}};
   }
 
@@ -2257,6 +2267,60 @@ static void DiagnoseNonTriviallyCopyableReason(Sema 
&SemaRef,
   }
 }
 
+static void DiagnoseNonConstructibleReason(
+    Sema &SemaRef, SourceLocation Loc,
+    const llvm::SmallVector<clang::QualType, 1> &Ts) {
+  if (Ts.empty()) {
+    return;
+  }
+
+  bool ContainsVoid = false;
+  for (const QualType &ArgTy : Ts) {
+    ContainsVoid |= ArgTy->isVoidType();
+  }
+
+  if (ContainsVoid)
+    SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+        << diag::TraitNotSatisfiedReason::CVVoidType;
+
+  QualType T = Ts[0];
+  if (T->isFunctionType())
+    SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+        << diag::TraitNotSatisfiedReason::FunctionType;
+
+  if (T->isIncompleteArrayType())
+    SemaRef.Diag(Loc, diag::note_unsatisfied_trait_reason)
+        << diag::TraitNotSatisfiedReason::IncompleteArrayType;
+
+  const CXXRecordDecl *D = T->getAsCXXRecordDecl();
+  if (!D || D->isInvalidDecl() || !D->hasDefinition())
+    return;
+
+  llvm::BumpPtrAllocator OpaqueExprAllocator;
+  SmallVector<Expr *, 2> ArgExprs;
+  ArgExprs.reserve(Ts.size() - 1);
+  for (unsigned I = 1, N = Ts.size(); I != N; ++I) {
+    QualType ArgTy = Ts[I];
+    if (ArgTy->isObjectType() || ArgTy->isFunctionType())
+      ArgTy = SemaRef.Context.getRValueReferenceType(ArgTy);
+    ArgExprs.push_back(
+        new (OpaqueExprAllocator.Allocate<OpaqueValueExpr>())
+            OpaqueValueExpr(Loc, ArgTy.getNonLValueExprType(SemaRef.Context),
+                            Expr::getValueKindForType(ArgTy)));
+  }
+
+  EnterExpressionEvaluationContext Unevaluated(
+      SemaRef, Sema::ExpressionEvaluationContext::Unevaluated);
+  Sema::ContextRAII TUContext(SemaRef,
+                              SemaRef.Context.getTranslationUnitDecl());
+  InitializedEntity To(InitializedEntity::InitializeTemporary(T));
+  InitializationKind InitKind(InitializationKind::CreateDirect(Loc, Loc, Loc));
+  InitializationSequence Init(SemaRef, To, InitKind, ArgExprs);
+
+  Init.Diagnose(SemaRef, To, InitKind, ArgExprs);
+  SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D;
+}
+
 static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef,
                                                SourceLocation Loc, QualType T) 
{
   SemaRef.Diag(Loc, diag::note_unsatisfied_trait)
@@ -2296,6 +2360,9 @@ void Sema::DiagnoseTypeTraitDetails(const Expr *E) {
   case UTT_IsTriviallyCopyable:
     DiagnoseNonTriviallyCopyableReason(*this, E->getBeginLoc(), Args[0]);
     break;
+  case TT_IsConstructible:
+    DiagnoseNonConstructibleReason(*this, E->getBeginLoc(), Args);
+    break;
   default:
     break;
   }
diff --git a/clang/test/CXX/drs/cwg18xx.cpp b/clang/test/CXX/drs/cwg18xx.cpp
index 5b4551ba0143b..9948075852135 100644
--- a/clang/test/CXX/drs/cwg18xx.cpp
+++ b/clang/test/CXX/drs/cwg18xx.cpp
@@ -564,11 +564,12 @@ struct A {
 namespace ex2 {
 #if __cplusplus >= 201103L
 struct Bar {
-  struct Baz {
+  struct Baz { // #cwg1890-Baz
     int a = 0;
   };
   static_assert(__is_constructible(Baz), "");
   // since-cxx11-error@-1 {{static assertion failed due to requirement 
'__is_constructible(cwg1890::ex2::Bar::Baz)'}}
+  // since-cxx11-note@#cwg1890-Baz {{'Baz' defined here}}
 };
 #endif
 } // namespace ex2
diff --git a/clang/test/SemaCXX/overload-resolution-deferred-templates.cpp 
b/clang/test/SemaCXX/overload-resolution-deferred-templates.cpp
index 7cb71e075d50e..46c3670848529 100644
--- a/clang/test/SemaCXX/overload-resolution-deferred-templates.cpp
+++ b/clang/test/SemaCXX/overload-resolution-deferred-templates.cpp
@@ -80,21 +80,30 @@ struct ImplicitlyCopyable {
 static_assert(__is_constructible(ImplicitlyCopyable, const 
ImplicitlyCopyable&));
 
 
-struct Movable {
+struct Movable { // #Movable
   template <typename T>
   requires __is_constructible(Movable, T) // #err-self-constraint-1
-  explicit Movable(T op) noexcept; // #1
-  Movable(Movable&&) noexcept = default; // #2
+  explicit Movable(T op) noexcept; // #Movable1
+  Movable(Movable&&) noexcept = default; // #Movable2
 };
 static_assert(__is_constructible(Movable, Movable&&));
 static_assert(__is_constructible(Movable, const Movable&));
-// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(Movable, const Movable &)'}}
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(Movable, const Movable &)'}} \
+// expected-error@-1 {{call to implicitly-deleted copy constructor of 
'Movable'}} \
+// expected-note@#Movable  {{'Movable' defined here}} \
+// expected-note@#Movable  {{candidate constructor (the implicit copy 
constructor) not viable: no known conversion from 'int' to 'const Movable' for 
1st argument}} \
+// expected-note@#Movable2  {{copy constructor is implicitly deleted because 
'Movable' has a user-declared move constructor}} \
+// expected-note@#Movable2  {{candidate constructor not viable: no known 
conversion from 'int' to 'Movable' for 1st argument}} \
+// expected-note@#Movable1  {{candidate template ignored: constraints not 
satisfied [with T = int]}}
+
 
 static_assert(__is_constructible(Movable, int));
-// expected-error@-1{{static assertion failed due to requirement 
'__is_constructible(Movable, int)'}} \
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(Movable, int)'}} \
+// expected-error@-1 {{no matching constructor for initialization of 
'Movable'}} \
 // expected-note@-1 2{{}}
 // expected-error@#err-self-constraint-1{{satisfaction of constraint 
'__is_constructible(Movable, T)' depends on itself}}
 // expected-note@#err-self-constraint-1 4{{}}
+// expected-note@#Movable  {{'Movable' defined here}}
 
 template <typename T>
 struct Members {
diff --git a/clang/test/SemaCXX/type-traits-unsatisfied-diags-std.cpp 
b/clang/test/SemaCXX/type-traits-unsatisfied-diags-std.cpp
index 329b611110c1d..a403a0450607a 100644
--- a/clang/test/SemaCXX/type-traits-unsatisfied-diags-std.cpp
+++ b/clang/test/SemaCXX/type-traits-unsatisfied-diags-std.cpp
@@ -20,6 +20,14 @@ struct is_trivially_copyable {
 
 template <typename T>
 constexpr bool is_trivially_copyable_v = __is_trivially_copyable(T);
+
+template <typename... Args>
+struct is_constructible {
+    static constexpr bool value = __is_constructible(Args...);
+};
+
+template <typename... Args>
+constexpr bool is_constructible_v = __is_constructible(Args...);
 #endif
 
 #ifdef STD2
@@ -44,6 +52,17 @@ using is_trivially_copyable  = 
__details_is_trivially_copyable<T>;
 
 template <typename T>
 constexpr bool is_trivially_copyable_v = __is_trivially_copyable(T);
+
+template <typename... Args>
+struct __details_is_constructible{
+    static constexpr bool value = __is_constructible(Args...);
+};
+
+template <typename... Args>
+using is_constructible  = __details_is_constructible<Args...>;
+
+template <typename... Args>
+constexpr bool is_constructible_v = __is_constructible(Args...);
 #endif
 
 
@@ -73,6 +92,15 @@ using is_trivially_copyable  = 
__details_is_trivially_copyable<T>;
 
 template <typename T>
 constexpr bool is_trivially_copyable_v = is_trivially_copyable<T>::value;
+
+template <typename... Args>
+struct __details_is_constructible : bool_constant<__is_constructible(Args...)> 
{};
+
+template <typename... Args>
+using is_constructible  = __details_is_constructible<Args...>;
+
+template <typename... Args>
+constexpr bool is_constructible_v = is_constructible<Args...>::value;
 #endif
 
 }
@@ -100,6 +128,15 @@ static_assert(std::is_trivially_copyable_v<int&>);
 // expected-note@-1 {{because it is a reference type}}
 
 
+static_assert(std::is_constructible<int, int>::value);
+
+static_assert(std::is_constructible<void>::value);
+// expected-error-re@-1 {{static assertion failed due to requirement 
'std::{{.*}}is_constructible<void>::value'}} \
+// expected-note@-1 {{because it is a cv void type}}
+static_assert(std::is_constructible_v<void>);
+// expected-error@-1 {{static assertion failed due to requirement 
'std::is_constructible_v<void>'}} \
+// expected-note@-1 {{because it is a cv void type}}
+
 namespace test_namespace {
     using namespace std;
     static_assert(is_trivially_relocatable<int&>::value);
@@ -119,6 +156,13 @@ namespace test_namespace {
     // expected-error@-1 {{static assertion failed due to requirement 
'is_trivially_copyable_v<int &>'}} \
     // expected-note@-1 {{'int &' is not trivially copyable}} \
     // expected-note@-1 {{because it is a reference type}}
+
+    static_assert(is_constructible<void>::value);
+    // expected-error-re@-1 {{static assertion failed due to requirement 
'{{.*}}is_constructible<void>::value'}} \
+    // expected-note@-1 {{because it is a cv void type}}
+    static_assert(is_constructible_v<void>);
+    // expected-error@-1 {{static assertion failed due to requirement 
'is_constructible_v<void>'}} \
+    // expected-note@-1 {{because it is a cv void type}}
 }
 
 
@@ -139,6 +183,15 @@ concept C2 = std::is_trivially_copyable_v<T>; // #concept4
 
 template <C2 T> void g2();  // #cand4
 
+template <typename... Args>
+requires std::is_constructible<Args...>::value void f3();  // #cand5
+
+template <typename... Args>
+concept C3 = std::is_constructible_v<Args...>; // #concept6
+
+template <C3 T> void g3();  // #cand6
+
+
 void test() {
     f<int&>();
     // expected-error@-1 {{no matching function for call to 'f'}} \
@@ -169,6 +222,19 @@ void test() {
     // expected-note@#concept4 {{because 'std::is_trivially_copyable_v<int &>' 
evaluated to false}} \
     // expected-note@#concept4 {{'int &' is not trivially copyable}} \
     // expected-note@#concept4 {{because it is a reference type}}
+
+    f3<void>();
+    // expected-error@-1 {{no matching function for call to 'f3'}} \
+    // expected-note@#cand5 {{candidate template ignored: constraints not 
satisfied [with Args = <void>]}} \
+    // expected-note-re@#cand5 {{because '{{.*}}is_constructible<void>::value' 
evaluated to false}} \
+    // expected-note@#cand5 {{because it is a cv void type}}
+
+    g3<void>();
+    // expected-error@-1 {{no matching function for call to 'g3'}} \
+    // expected-note@#cand6 {{candidate template ignored: constraints not 
satisfied [with T = void]}} \
+    // expected-note@#cand6 {{because 'void' does not satisfy 'C3'}} \
+    // expected-note@#concept6 {{because 'std::is_constructible_v<void>' 
evaluated to false}} \
+    // expected-note@#concept6 {{because it is a cv void type}}
 }
 }
 
diff --git a/clang/test/SemaCXX/type-traits-unsatisfied-diags.cpp 
b/clang/test/SemaCXX/type-traits-unsatisfied-diags.cpp
index a8c78f6304ca9..d0b3f294fbcab 100644
--- a/clang/test/SemaCXX/type-traits-unsatisfied-diags.cpp
+++ b/clang/test/SemaCXX/type-traits-unsatisfied-diags.cpp
@@ -488,3 +488,65 @@ static_assert(__is_trivially_copyable(S12));
 // expected-note@-1 {{'S12' is not trivially copyable}} \
 // expected-note@#tc-S12 {{'S12' defined here}}
 }
+
+namespace constructible {
+
+struct S1 {  // #c-S1
+    S1(int); // #cc-S1
+};
+static_assert(__is_constructible(S1, char*));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(constructible::S1, char *)'}} \
+// expected-error@-1 {{no matching constructor for initialization of 'S1'}} \
+// expected-note@#c-S1 {{candidate constructor (the implicit copy constructor) 
not viable: no known conversion from 'char *' to 'const S1' for 1st argument}} \
+// expected-note@#c-S1 {{candidate constructor (the implicit move constructor) 
not viable: no known conversion from 'char *' to 'S1' for 1st argument}} \
+// expected-note@#cc-S1 {{candidate constructor not viable: no known 
conversion from 'char *' to 'int' for 1st argument; dereference the argument 
with *}} \
+// expected-note@#c-S1 {{'S1' defined here}}
+
+struct S2 { // #c-S2
+    S2(int, float, double); // #cc-S2
+};
+static_assert(__is_constructible(S2, float));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(constructible::S2, float)'}} \
+// expected-note@#c-S2 {{candidate constructor (the implicit copy constructor) 
not viable: no known conversion from 'float' to 'const S2' for 1st argument}} \
+// expected-note@#c-S2 {{candidate constructor (the implicit move constructor) 
not viable: no known conversion from 'float' to 'S2' for 1st argument}} \
+// expected-error@-1 {{no matching constructor for initialization of 'S2'}} \
+// expected-note@#cc-S2 {{candidate constructor not viable: requires 3 
arguments, but 1 was provided}} \
+// expected-note@#c-S2 {{'S2' defined here}}
+
+static_assert(__is_constructible(S2, float, void));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(constructible::S2, float, void)'}} \
+// expected-note@#c-S2 {{candidate constructor (the implicit move constructor) 
not viable: requires 1 argument, but 2 were provided}} \
+// expected-note@#c-S2 {{candidate constructor (the implicit copy constructor) 
not viable: requires 1 argument, but 2 were provided}} \
+// expected-note@-1{{because it is a cv void type}} \
+// expected-error@-1 {{no matching constructor for initialization of 'S2'}} \
+// expected-note@#cc-S2 {{candidate constructor not viable: requires 3 
arguments, but 2 were provided}} \
+// expected-note@#c-S2 {{'S2' defined here}}
+
+static_assert(__is_constructible(int[]));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(int[])'}} \
+// expected-note@-1 {{because it is an incomplete array type}}
+
+static_assert(__is_constructible(void));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(void)'}} \
+// expected-note@-1 {{because it is a cv void type}}
+
+static_assert(__is_constructible(void, void));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(void, void)'}} \
+// expected-note@-1 {{because it is a cv void type}}
+
+static_assert(__is_constructible(const void));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(const void)'}} \
+// expected-note@-1 {{because it is a cv void type}}
+
+static_assert(__is_constructible(volatile void));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(volatile void)'}} \
+// expected-note@-1 {{because it is a cv void type}}
+
+static_assert(__is_constructible(int ()));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(int ())'}} \
+// expected-note@-1 {{because it is a function type}}
+
+static_assert(__is_constructible(void (int, float)));
+// expected-error@-1 {{static assertion failed due to requirement 
'__is_constructible(void (int, float))'}} \
+// expected-note@-1 {{because it is a function type}}
+}

>From 9c9a32dfbb89495523d28e57164934f15d2c5293 Mon Sep 17 00:00:00 2001
From: Shamshura Egor <shamshurae...@gmail.com>
Date: Sat, 14 Jun 2025 12:55:34 +0000
Subject: [PATCH 2/6] Update diagnostics checks in libc++ tests.

---
 clang/lib/Sema/SemaTypeTraits.cpp                             | 1 +
 .../expected/expected.expected/and_then.mandates.verify.cpp   | 4 ++++
 .../expected/expected.expected/or_else.mandates.verify.cpp    | 4 ++++
 .../expected/expected.expected/value.observers.verify.cpp     | 2 ++
 .../expected/expected.void/and_then.mandates.verify.cpp       | 4 ++++
 .../sequences/array/array.creation/to_array.verify.cpp        | 1 +
 .../std/containers/views/mdspan/mdspan/conversion.verify.cpp  | 2 ++
 .../function.objects/func.bind.partial/bind_back.verify.cpp   | 2 ++
 .../function.objects/func.bind_front/bind_front.verify.cpp    | 1 +
 9 files changed, 21 insertions(+)

diff --git a/clang/lib/Sema/SemaTypeTraits.cpp 
b/clang/lib/Sema/SemaTypeTraits.cpp
index 22c690bedc1ed..fa31fee4708fd 100644
--- a/clang/lib/Sema/SemaTypeTraits.cpp
+++ b/clang/lib/Sema/SemaTypeTraits.cpp
@@ -13,6 +13,7 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/TemplateBase.h"
 #include "clang/AST/Type.h"
+#include "clang/Basic/DiagnosticIDs.h"
 #include "clang/Basic/DiagnosticParse.h"
 #include "clang/Basic/DiagnosticSema.h"
 #include "clang/Basic/TypeTraits.h"
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
index c46ab633295c1..101e7f56e1580 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
@@ -55,6 +55,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(value()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -74,6 +75,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(value()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -94,6 +96,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(value())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -113,6 +116,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(value())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
index af1fa53307960..fa0932f1a75e9 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
@@ -55,6 +55,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(error()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
@@ -74,6 +75,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(error()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
@@ -93,6 +95,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(error())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
@@ -112,6 +115,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(error())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
index d2b62a9b6ab99..1b8780ceb779e 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
@@ -82,6 +82,7 @@ void test() {
       std::expected<int, MoveOnly> e;
       [[maybe_unused]] auto val = std::move(e).value();
       // expected-error-re@*:* {{static assertion failed {{.*}}error_type has 
to be both copy constructible and constructible from 
decltype(std::move(error()))}}
+      // expected-error@*:* {{call to deleted constructor of 'MoveOnly'}}
     }
 
     // is_copy_constructible_v<E> is true and is_constructible_v<E, 
decltype(std::move(error()))> is true.
@@ -95,6 +96,7 @@ void test() {
       std::expected<int, CopyConstructibleButNotMoveConstructible> e;
       [[maybe_unused]] auto val = std::move(e).value();
       // expected-error-re@*:* {{static assertion failed {{.*}}error_type has 
to be both copy constructible and constructible from 
decltype(std::move(error()))}}
+      // expected-error@*:* {{call to deleted constructor of 
'CopyConstructibleButNotMoveConstructible'}}
     }
   }
 
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
index e1a7ec5ff4d72..14936d85313e6 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
@@ -55,6 +55,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -74,6 +75,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -93,6 +95,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -112,6 +115,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
+      // expected-error@*:* {{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
diff --git 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
index 9e7b456bce18b..d2e777c4c2f51 100644
--- 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
+++ 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
@@ -29,6 +29,7 @@ int main(int, char**) {
     MoveOnly mo[] = {MoveOnly{3}};
     // expected-error@array:* {{to_array requires copy constructible elements}}
     // expected-error-re@array:* {{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
+    // expected-error@array:* {{call to deleted constructor of 'MoveOnly'}}
     std::to_array(mo); // expected-note {{requested here}}
   }
 
diff --git 
a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp 
b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp
index d46ba6ffbe5ec..fed4b1b34190e 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp
@@ -43,6 +43,7 @@ void cant_construct_data_handle_type() {
   int data;
   std::mdspan<int, std::extents<int>, std::layout_right, 
convertible_accessor_but_not_handle<int>> m_nc(&data);
   // expected-error-re@*:* {{{{.*}}no matching constructor for initialization 
of {{.*}} (aka 'not_const_convertible_handle<const int>')}}
+  // expected-error@*:* {{no matching constructor for initialization of 
'not_const_convertible_handle<const int>'}}
   // expected-error-re@*:* {{static assertion failed {{.*}}mdspan: 
incompatible data_handle_type for mdspan construction}}
   [[maybe_unused]] std::
       mdspan<const int, std::extents<int>, std::layout_right, 
convertible_accessor_but_not_handle<const int>> m_c(m_nc);
@@ -52,5 +53,6 @@ void mapping_constructible_despite_extents_compatibility() {
   int data;
   std::mdspan<int, std::extents<int>, always_convertible_layout> m(&data);
   // expected-error-re@*:* {{static assertion failed {{.*}}mdspan: 
incompatible extents for mdspan construction}}
+  // expected-error@*:* {{no matching constructor for initialization of 
'std::extents<int, 5>'}}
   [[maybe_unused]] std::mdspan<int, std::extents<int, 5>, 
always_convertible_layout> m2(m);
 }
diff --git 
a/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
 
b/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
index eb100c15f580d..91656a1f4b2f1 100644
--- 
a/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
+++ 
b/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
@@ -69,6 +69,8 @@ void test() {
     auto f = std::bind_back([](const Arg&) {}, x);
     // expected-error-re@*:* {{static assertion failed{{.*}}bind_back requires 
all decay_t<Args> to be constructible from respective Args}}
     // expected-error@*:* {{no matching constructor for initialization}}
+    // expected-error@*:* {{call to deleted constructor of 'F'}}
+    // expected-error@*:* {{call to deleted constructor of 'Arg'}}
   }
 
   { // Mandates: (is_move_constructible_v<decay_t<Args>> && ...)
diff --git 
a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
 
b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
index 5100259bd5b29..5c6a78b2b8b66 100644
--- 
a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
+++ 
b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
@@ -42,4 +42,5 @@ void f() {
     auto d = std::bind_front(do_nothing, n); // expected-error {{no matching 
function for call to 'bind_front'}}
 
     auto t = std::bind_front(testNotMoveConst, NotMoveConst(0)); // 
expected-error {{no matching function for call to 'bind_front'}}
+    // expected-error@*:* {{call to deleted constructor of 'NotMoveConst'}}
 }

>From eeb8d3d2728506fe374ba07e8ff22b3b65f9dae9 Mon Sep 17 00:00:00 2001
From: Shamshura Egor <shamshurae...@gmail.com>
Date: Mon, 16 Jun 2025 03:02:05 +0000
Subject: [PATCH 3/6] Updated expected error in diagnostic checks in libcxx
 tests.

---
 .../expected.expected/and_then.mandates.verify.cpp        | 8 ++++----
 .../expected.expected/or_else.mandates.verify.cpp         | 8 ++++----
 .../expected/expected.expected/value.observers.verify.cpp | 4 ++--
 .../expected/expected.void/and_then.mandates.verify.cpp   | 8 ++++----
 .../sequences/array/array.creation/to_array.verify.cpp    | 2 +-
 .../containers/views/mdspan/mdspan/conversion.verify.cpp  | 4 ++--
 .../func.bind.partial/bind_back.verify.cpp                | 4 ++--
 .../func.bind_front/bind_front.verify.cpp                 | 2 +-
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
index 101e7f56e1580..fbd2317ebeee2 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp
@@ -55,7 +55,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(value()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -75,7 +75,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(value()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -96,7 +96,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(value())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -116,7 +116,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(value())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
index fa0932f1a75e9..553ac4c6033a5 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/or_else.mandates.verify.cpp
@@ -55,7 +55,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(error()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
@@ -75,7 +75,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(error()) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
@@ -95,7 +95,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(error())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
@@ -115,7 +115,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f(std::move(error())) must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<G:value_type, T>
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
index 1b8780ceb779e..751bf9ca44ed6 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
@@ -82,7 +82,7 @@ void test() {
       std::expected<int, MoveOnly> e;
       [[maybe_unused]] auto val = std::move(e).value();
       // expected-error-re@*:* {{static assertion failed {{.*}}error_type has 
to be both copy constructible and constructible from 
decltype(std::move(error()))}}
-      // expected-error@*:* {{call to deleted constructor of 'MoveOnly'}}
+      // expected-error@*:* 0-1{{call to deleted constructor of 'MoveOnly'}}
     }
 
     // is_copy_constructible_v<E> is true and is_constructible_v<E, 
decltype(std::move(error()))> is true.
@@ -96,7 +96,7 @@ void test() {
       std::expected<int, CopyConstructibleButNotMoveConstructible> e;
       [[maybe_unused]] auto val = std::move(e).value();
       // expected-error-re@*:* {{static assertion failed {{.*}}error_type has 
to be both copy constructible and constructible from 
decltype(std::move(error()))}}
-      // expected-error@*:* {{call to deleted constructor of 
'CopyConstructibleButNotMoveConstructible'}}
+      // expected-error@*:* 0-1{{call to deleted constructor of 
'CopyConstructibleButNotMoveConstructible'}}
     }
   }
 
diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
index 14936d85313e6..1df6cbf543b4f 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp
@@ -55,7 +55,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -75,7 +75,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -95,7 +95,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
@@ -115,7 +115,7 @@ void test() {
       // expected-error-re@*:* {{static assertion failed {{.*}}The result of 
f() must be a specialization of std::expected}}
       // expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it 
has no members}}
       // expected-error-re@*:* {{no matching constructor for initialization 
of{{.*}}}}
-      // expected-error@*:* {{excess elements in struct initializer}}
+      // expected-error@*:* 0-1{{excess elements in struct initializer}}
     }
 
     // !std::is_same_v<U:error_type, E>
diff --git 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
index d2e777c4c2f51..8fc77a707c121 100644
--- 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
+++ 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
@@ -29,7 +29,7 @@ int main(int, char**) {
     MoveOnly mo[] = {MoveOnly{3}};
     // expected-error@array:* {{to_array requires copy constructible elements}}
     // expected-error-re@array:* {{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
-    // expected-error@array:* {{call to deleted constructor of 'MoveOnly'}}
+    // expected-error@array:* 0-1{{call to deleted constructor of 'MoveOnly'}}
     std::to_array(mo); // expected-note {{requested here}}
   }
 
diff --git 
a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp 
b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp
index fed4b1b34190e..cd4d4d9a7c9da 100644
--- a/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp
+++ b/libcxx/test/std/containers/views/mdspan/mdspan/conversion.verify.cpp
@@ -43,7 +43,7 @@ void cant_construct_data_handle_type() {
   int data;
   std::mdspan<int, std::extents<int>, std::layout_right, 
convertible_accessor_but_not_handle<int>> m_nc(&data);
   // expected-error-re@*:* {{{{.*}}no matching constructor for initialization 
of {{.*}} (aka 'not_const_convertible_handle<const int>')}}
-  // expected-error@*:* {{no matching constructor for initialization of 
'not_const_convertible_handle<const int>'}}
+  // expected-error@*:* 0-1{{no matching constructor for initialization of 
'not_const_convertible_handle<const int>'}}
   // expected-error-re@*:* {{static assertion failed {{.*}}mdspan: 
incompatible data_handle_type for mdspan construction}}
   [[maybe_unused]] std::
       mdspan<const int, std::extents<int>, std::layout_right, 
convertible_accessor_but_not_handle<const int>> m_c(m_nc);
@@ -53,6 +53,6 @@ void mapping_constructible_despite_extents_compatibility() {
   int data;
   std::mdspan<int, std::extents<int>, always_convertible_layout> m(&data);
   // expected-error-re@*:* {{static assertion failed {{.*}}mdspan: 
incompatible extents for mdspan construction}}
-  // expected-error@*:* {{no matching constructor for initialization of 
'std::extents<int, 5>'}}
+  // expected-error@*:* 0-1{{no matching constructor for initialization of 
'std::extents<int, 5>'}}
   [[maybe_unused]] std::mdspan<int, std::extents<int, 5>, 
always_convertible_layout> m2(m);
 }
diff --git 
a/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
 
b/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
index 91656a1f4b2f1..6a63b65bf148e 100644
--- 
a/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
+++ 
b/libcxx/test/std/utilities/function.objects/func.bind.partial/bind_back.verify.cpp
@@ -69,8 +69,8 @@ void test() {
     auto f = std::bind_back([](const Arg&) {}, x);
     // expected-error-re@*:* {{static assertion failed{{.*}}bind_back requires 
all decay_t<Args> to be constructible from respective Args}}
     // expected-error@*:* {{no matching constructor for initialization}}
-    // expected-error@*:* {{call to deleted constructor of 'F'}}
-    // expected-error@*:* {{call to deleted constructor of 'Arg'}}
+    // expected-error@*:* 0-1{{call to deleted constructor of 'F'}}
+    // expected-error@*:* 0-1{{call to deleted constructor of 'Arg'}}
   }
 
   { // Mandates: (is_move_constructible_v<decay_t<Args>> && ...)
diff --git 
a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
 
b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
index 5c6a78b2b8b66..27a1fba90329a 100644
--- 
a/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
+++ 
b/libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
@@ -42,5 +42,5 @@ void f() {
     auto d = std::bind_front(do_nothing, n); // expected-error {{no matching 
function for call to 'bind_front'}}
 
     auto t = std::bind_front(testNotMoveConst, NotMoveConst(0)); // 
expected-error {{no matching function for call to 'bind_front'}}
-    // expected-error@*:* {{call to deleted constructor of 'NotMoveConst'}}
+    // expected-error@*:* 0-1{{call to deleted constructor of 'NotMoveConst'}}
 }

>From 183c91922de19970377ae905b00a42fbef137a56 Mon Sep 17 00:00:00 2001
From: Shamshura Egor <shamshurae...@gmail.com>
Date: Mon, 16 Jun 2025 03:33:18 +0000
Subject: [PATCH 4/6] Fixed tests.

---
 .../expected/expected.expected/value.observers.verify.cpp     | 4 ++--
 .../sequences/array/array.creation/to_array.verify.cpp        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
index 751bf9ca44ed6..df2abe11c9cc3 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
@@ -126,8 +126,8 @@ void test() {
 #if _LIBCPP_HAS_EXCEPTIONS
   // expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
   // expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
-  // expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
-  // expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
+  // expected-error-re@*:* 0-1{{call to deleted constructor of{{.*}}}}
+  // expected-error-re@*:* 0-1{{call to deleted constructor of{{.*}}}}
 #endif
 }
 // clang-format on
diff --git 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
index 8fc77a707c121..66391a09445f9 100644
--- 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
+++ 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
@@ -28,7 +28,7 @@ int main(int, char**) {
   {
     MoveOnly mo[] = {MoveOnly{3}};
     // expected-error@array:* {{to_array requires copy constructible elements}}
-    // expected-error-re@array:* {{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
+    // expected-error-re@array:* 0-1{{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
     // expected-error@array:* 0-1{{call to deleted constructor of 'MoveOnly'}}
     std::to_array(mo); // expected-note {{requested here}}
   }

>From 857c4d53ec13163afc3d8dc6e436d0145183c05f Mon Sep 17 00:00:00 2001
From: Shamshura Egor <shamshurae...@gmail.com>
Date: Mon, 16 Jun 2025 03:46:46 +0000
Subject: [PATCH 5/6] Fixed.

---
 .../sequences/array/array.creation/to_array.verify.cpp          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
index 66391a09445f9..57450d968587f 100644
--- 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
+++ 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
@@ -36,7 +36,7 @@ int main(int, char**) {
   {
     const MoveOnly cmo[] = {MoveOnly{3}};
     // expected-error@array:* {{to_array requires move constructible elements}}
-    // expected-error-re@array:* {{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
+    // expected-error-re@array:* 0-1{{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
     std::to_array(std::move(cmo)); // expected-note {{requested here}}
   }
 

>From d5be40cd73ddc3ccff6ad47ec80820ca68175167 Mon Sep 17 00:00:00 2001
From: Shamshura Egor <shamshurae...@gmail.com>
Date: Mon, 16 Jun 2025 07:59:46 +0000
Subject: [PATCH 6/6] Removed redundant expected-error.

---
 .../expected/expected.expected/value.observers.verify.cpp   | 6 ++----
 .../sequences/array/array.creation/to_array.verify.cpp      | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
index df2abe11c9cc3..f18137ce99a72 100644
--- 
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
+++ 
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
@@ -82,7 +82,6 @@ void test() {
       std::expected<int, MoveOnly> e;
       [[maybe_unused]] auto val = std::move(e).value();
       // expected-error-re@*:* {{static assertion failed {{.*}}error_type has 
to be both copy constructible and constructible from 
decltype(std::move(error()))}}
-      // expected-error@*:* 0-1{{call to deleted constructor of 'MoveOnly'}}
     }
 
     // is_copy_constructible_v<E> is true and is_constructible_v<E, 
decltype(std::move(error()))> is true.
@@ -96,7 +95,6 @@ void test() {
       std::expected<int, CopyConstructibleButNotMoveConstructible> e;
       [[maybe_unused]] auto val = std::move(e).value();
       // expected-error-re@*:* {{static assertion failed {{.*}}error_type has 
to be both copy constructible and constructible from 
decltype(std::move(error()))}}
-      // expected-error@*:* 0-1{{call to deleted constructor of 
'CopyConstructibleButNotMoveConstructible'}}
     }
   }
 
@@ -126,8 +124,8 @@ void test() {
 #if _LIBCPP_HAS_EXCEPTIONS
   // expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
   // expected-error-re@*:* {{call to deleted constructor of{{.*}}}}
-  // expected-error-re@*:* 0-1{{call to deleted constructor of{{.*}}}}
-  // expected-error-re@*:* 0-1{{call to deleted constructor of{{.*}}}}
+  // expected-error-re@*:* 1-2{{call to deleted constructor of{{.*}}}}
+  // expected-error-re@*:* 1-2{{call to deleted constructor of{{.*}}}}
 #endif
 }
 // clang-format on
diff --git 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
index 57450d968587f..f4a985cff5373 100644
--- 
a/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
+++ 
b/libcxx/test/std/containers/sequences/array/array.creation/to_array.verify.cpp
@@ -28,15 +28,14 @@ int main(int, char**) {
   {
     MoveOnly mo[] = {MoveOnly{3}};
     // expected-error@array:* {{to_array requires copy constructible elements}}
-    // expected-error-re@array:* 0-1{{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
-    // expected-error@array:* 0-1{{call to deleted constructor of 'MoveOnly'}}
+    // expected-error-re@array:* 1-2{{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
     std::to_array(mo); // expected-note {{requested here}}
   }
 
   {
     const MoveOnly cmo[] = {MoveOnly{3}};
     // expected-error@array:* {{to_array requires move constructible elements}}
-    // expected-error-re@array:* 0-1{{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
+    // expected-error-re@array:* {{{{(call to implicitly-deleted copy 
constructor of 'MoveOnly')|(call to deleted constructor of 'MoveOnly')}}}}
     std::to_array(std::move(cmo)); // expected-note {{requested here}}
   }
 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to