[clang] [clang]: fix overload resolution in case of converting const value reference to an rvalue reference. (PR #133035)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 25 21:58:15 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Nhat Nguyen  (changkhothuychung)

<details>
<summary>Changes</summary>

fix #<!-- -->132600


---
Full diff: https://github.com/llvm/llvm-project/pull/133035.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaOverload.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 6d8006b35dcf4..28843f378c686 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -5419,7 +5419,7 @@ TryReferenceInit(Sema &S, Expr *Init, QualType DeclType,
   //   the argument expression. Any difference in top-level
   //   cv-qualification is subsumed by the initialization itself
   //   and does not constitute a conversion.
-  ICS = TryImplicitConversion(S, Init, T1, SuppressUserConversions,
+  ICS = TryImplicitConversion(S, Init, DeclType, SuppressUserConversions,
                               AllowedExplicit::None,
                               /*InOverloadResolution=*/false,
                               /*CStyle=*/false,

``````````

</details>


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


More information about the cfe-commits mailing list