http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60565

            Bug ID: 60565
           Summary: Bogus not-in-scope error
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at parcs dot ath.cx

The following file fails to compile due to a bogus not-in-scope error for
B::foo ():

namespace A
{
    extern "C" void foo () throw ();
}

namespace B
{
    extern "C" void foo ();
}

int
main ()
{
    foo ();
}



$ g++ -c exc.C
exc.C:8:26: warning: declaration of ‘void B::foo()’ with C language linkage
[enabled by default]
     extern "C" void foo ();
                          ^
exc.C:3:21: warning: conflicts with previous declaration ‘void A::foo()’
[enabled by default]
     extern "C" void foo () throw ();
                     ^
exc.C:8:26: warning: due to different exception specifications [enabled by
default]
     extern "C" void foo ();
                          ^
exc.C: In function ‘int main()’:
exc.C:14:5: error: ‘foo’ is not a member of ‘B’
     B::foo ();
     ^
exc.C:14:5: note: suggested alternative:
exc.C:3:21: note:   ‘A::foo’
     extern "C" void foo () throw ();
                     ^

Reply via email to