https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98044

            Bug ID: 98044
           Summary: Last line always highlighted as error in constructor
                    initializer list when another is bogus
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at linkmauve dot fr
  Target Milestone: ---

Created attachment 49641
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49641&action=edit
Testcase reproducing this badly-placed error

When a constructor has an initializer list with one being bogus, the error
doesn’t point to the correct line but always to the last one.

In the attached testcase, g++ correctly identifies foo(1, 2) as the culprit,
but highlights bar() as the error:

testcase.cpp:13:8: error: no matching function for call to ‘Foo::Foo(int, int)’
   13 |  , bar()

Reply via email to