]> gcc.gnu.org Git - gcc.git/commit
c++: print conversion error at candidate location
authorJason Merrill <jason@redhat.com>
Thu, 23 Mar 2023 14:43:58 +0000 (10:43 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 27 Apr 2023 15:54:43 +0000 (11:54 -0400)
commit14e881eb0305090e5b184806b917d492373d32ea
tree4f3ca383d8edce20aae7148ee1ae048e3939775b
parente0cf929d99bebd9a740db6db45d69957514e0c12
c++: print conversion error at candidate location

In testcases like this one, the printing of candidates in a diagnostic has
been longer than necessary because it jumps back and forth between the call
site and the candidate site.  So here, we first say at the call site that no
match was found; then we note the candidate site, and then explain why it's
not suitable back at the call site, which means printing the call site line
with caret again.  With this patch, the conversion diagnostic is at the same
location as the candidate, so we don't need to print any input line.

gcc/cp/ChangeLog:

* call.cc (print_conversion_rejection): Use iloc_sentinel.

gcc/testsuite/ChangeLog:

* g++.dg/template/copy1.C: Adjust error lines.
gcc/cp/call.cc
gcc/testsuite/g++.dg/template/copy1.C
This page took 0.052753 seconds and 5 git commands to generate.