================
@@ -108,8 +108,11 @@ struct Foo {
   Foo(T const (&)[N]);
 };
 
+// FIXME: Prefer non-canonical template arguments in the deduction guide?
 template <typename X, int Y>
 using Bar = Foo<X, sizeof(X)>; // expected-note {{candidate template ignored: 
couldn't infer template argument 'X'}} \
+                               // expected-note {{implicit deduction guide 
declared as 'template <typename X> Bar(Foo<type-parameter-0-0, 
sizeof(type-parameter-0-0)>) -> Foo<type-parameter-0-0, 
sizeof(type-parameter-0-0)>'}} \
----------------
zyn0217 wrote:

I think it's because we attach the `__is_deducible` constraint to the 
`TemplateParameterList` rather than the `FunctionDecl` corresponding to the 
synthesized deduction guide. And we don't have a handling in `DeclPrinter` that 
prints such trailing expressions for template parameters...

I could try adding such logic to `DeclPrinter` and see if it doesn't break 
anything seriously. Otherwise, we probably need to tweak our 
`BuildDeductionGuideForTypeAlias` so that we attach the constraints to the 
function decl. (I assume there aren't many differences between the two, i.e. 
attaching it to the function Decl or to the template parameter list?)

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

Reply via email to