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

Adam H. Peterson <alphaetapi at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alphaetapi at hotmail dot
                   |                            |com

--- Comment #1 from Adam H. Peterson <alphaetapi at hotmail dot com> 2012-04-16 
23:22:47 UTC ---
I get the same results here.  I've also determined that the problem doesn't
rely on using operator overloading or #include-ing <iostream>.  Here's a
program that fails similarly without using either (and in fact has no
#includes):


namespace one {
    class A { };
}
void func(const ::one::A& ) { }

namespace two {
    class unrelated_a {
        friend void func( const unrelated_a& );
    };
    #if not defined MAKE_IT_WORK
    class unrelated_b {
        friend void func( const unrelated_b& );
    };
    #endif

    void output( const one::A& val ) {
        func(val);
    }
}
int main() {
    two::output( one::A() );
}



With the above code, I get "'func' was not declared in this scope" inside
output()'s body.  While it's true that func() is not declared in namespace two,
it is in the global scope.  And in fact, apparently it is found if the
definition for class unrelated_b is removed.

Reply via email to