================
@@ -1426,6 +1727,34 @@ void Sema::DeclareImplicitDeductionGuides(TemplateDecl 
*Template,
   if (!AddedAny)
     Transform.buildSimpleDeductionGuide(std::nullopt);
 
+  // FIXME: Handle explicit deduction guides from inherited constructors
+  // when the base deduction guides are declared after this has first run
+  if (getLangOpts().CPlusPlus23 &&
+      Pattern->getTemplatedDecl()->hasDefinition()) {
+    unsigned BaseIdx = 0;
+    for (const auto &Base : Pattern->getTemplatedDecl()->bases()) {
+      ++BaseIdx;
+      if (!Base.getType()->isDependentType())
----------------
antangelo wrote:

I've updated the method of looking up inherited constructors to use the 
`UnresolvedUsingValueDecl`s on the pattern directly instead of finding them 
through the list of bases. It will now create generic deduction guides for 
`B<T2>` in your example, which will work in the case of `B<int>` but fail after 
instantiation if `T2` is not `int`.

https://github.com/llvm/llvm-project/pull/98788
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to