[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 08:40:21 PDT 2024


================
@@ -11757,6 +11791,42 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated,
       return;
     }
 
+    // Errors in deduction guides from inherited constructors
+    // will manifest as substitution failures in the return type
+    // partial specialization, so we show a generic diagnostic
+    // in this case.
+    if (auto *DG = dyn_cast<CXXDeductionGuideDecl>(Templated);
----------------
AaronBallman wrote:

```suggestion
    if (const auto *DG = dyn_cast<CXXDeductionGuideDecl>(Templated);
```
and handle const correctness further down as well.

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


More information about the cfe-commits mailing list