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

            Bug ID: 108204
           Summary: pr84973-2.C fails with wrong error on mingw
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

All of the pr84973-2.C tests fail on mingw.  They give the output:

g++.dg/template/pr84973-2.C: In instantiation of 'void a()::c::b() [with int
<anonymous> = 0]':
g++.dg/template/pr84973-2.C:7:3:   required from 'void a() [with int
<anonymous> = 0]'
g++.dg/template/pr84973-2.C:12:7:   required from here
g++.dg/template/pr84973-2.C:5:20: error: statement cannot resolve address of
overloaded function

or outside the testsuite for slightly different formatting:
$ x86_64-w64-mingw32-g++ -c a.cc
a.cc: In instantiation of 'void a()::c::b() [with int <anonymous> = 0]':
a.cc:5:11:   required from 'void a() [with int <anonymous> = 0]'
a.cc:10:8:   required from here
a.cc:3:38: error: statement cannot resolve address of overloaded function
    3 |                       void b() try { b; } catch (short) { // { dg-error
"invalid use" }
      |                                      ^

On linux, however, the output is different:
a.cc: In instantiation of 'void a()::c::b() [with int <anonymous> = 0]':
a.cc:5:11:   required from 'void a() [with int <anonymous> = 0]'
a.cc:10:8:   required from here
a.cc:3:38: error: invalid use of non-static member function 'void a()::c::b()
[with int <anonymous> = 0]'
    3 |                       void b() try { b; } catch (short) { // { dg-error
"invalid use" }
      |                                      ^
a.cc:3:28: note: declared here
    3 |                       void b() try { b; } catch (short) { // { dg-error
"invalid use" }
      |                            ^

Reply via email to