[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 25 05:22:47 PDT 2024


================
@@ -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)>'}} \
+                               // expected-note {{implicit deduction guide declared as 'template <typename X> Bar(const type-parameter-0-0 (&)[sizeof(type-parameter-0-0)]) -> Foo<type-parameter-0-0, sizeof(type-parameter-0-0)>'}} \
                                // expected-note {{candidate template ignored: constraints not satisfied [with X = int]}} \
----------------
zyn0217 wrote:

@hokein I think the `constraints not satisfied` is still a bit confusing after #92389? There is no constraint explicitly written in the code, although the note actually refers to the implicit constraint `__is_deducible`.

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


More information about the cfe-commits mailing list