https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106285
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
FWIW with the patches I've proposed for PR other/116253, the output for this
testcase becomes:
$ ./xgcc -B. -S -fdiagnostics-set-output=text:experimental-nesting=yes
-std=c++20 -fconcepts-diagnostics-depth=3
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C
-I../x86_64-pc-linux-gnu/libstdc++-v3/include
-I../../src/libstdc++-v3/include
-I../x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I../../src/libstdc++-v3/libsupc++
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C:20:21:
error: no matching function for call to ‘C<int, int>::C(<brace-enclosed
initializer list>, <brace-enclosed initializer list>)’
20 | C<int, int> c({}, {});
| ^
• we found 4 candidates
• candidate 1: ‘template<class AA, class BB> C<A, B>::C(AA&, BB&,
__secret_tag) [with BB = AA; A = int; B = int]’
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C:16:5:
16 | C(AA&, BB&, __secret_tag)
| ^
• candidate expects 3 arguments, 2 provided
• candidate 2: ‘template<class AA, class BB> C<A, B>::C(AA, BB) [with BB =
AA; A = int; B = int]’
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C:8:5:
8 | C(AA, BB)
| ^
• template argument deduction/substitution failed:
• couldn’t deduce template parameter ‘AA’
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C:20:21:
20 | C<int, int> c({}, {});
| ^
• candidate 3: ‘constexpr C<A, B>::C(C<A, B>&&) [with A = int; B = int]’
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C:11:3:
11 | C(C&&) = default;
| ^
• candidate expects 1 argument, 2 provided
• candidate 4: ‘constexpr C<A, B>::C() [with A = int; B = int]’
../../src/gcc/testsuite/g++.dg/template/nested-diagnostics-pr106285.C:5:3:
5 | C() = default;
| ^
• candidate expects 0 arguments, 2 provided
I was about to mark this as a duplicate of PR other/116253 as it shows the
structure, but there's one other idea here: the patches don't yet put the
"reason for failure" before the "location of decl" as suggested in comment #2.
I'll experiment with doing that next.