================
@@ -11322,9 +11322,22 @@ Decl 
*Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) {
       << ClassType << ConvType;
   }
 
-  if (FunctionTemplateDecl *ConversionTemplate
-                                = Conversion->getDescribedFunctionTemplate())
+  if (FunctionTemplateDecl *ConversionTemplate =
+          Conversion->getDescribedFunctionTemplate()) {
+    if (ConvType->isUndeducedAutoType()) {
+      Diag(Conversion->getTypeSpecStartLoc(), diag::err_auto_not_allowed)
+          << Conversion->getTypeSourceInfo()
+                 ->getTypeLoc()
+                 .getContainedAutoTypeLoc()
----------------
cor3ntin wrote:

I think this is a slightly bigger hammer than it needs to be.
I think we should just use `->getTypeLoc().getSourceRange()` (yes, it would be 
the source range of the type + qualifiers, but i think that's as good, if not 
better

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

Reply via email to