This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/23886] New: friend in containing namespace is not found


$HOME/gcc-4.0.1/bin/g++ --version
g++ (GCC) 4.0.1

Built like this (from config.status):

../gcc-4.0.1/configure   --prefix=$HOME/gcc-4.0.1
--with-gcc-version-trigger=$HOME/reference/gnu/gcc-4.0.1/gcc/version.c
--enable-languages=c,c++,java,objc

----------------------------------------------------------------------
namespace Foo {
  class A;

  namespace Bar {
    class B {
    public:
      friend class A;
    private:
      B();
    };
  }

  class A {
  public:
    A() {}
  private:
    Bar::B _b; 
  };
}
----------------------------------------------------------------------

$HOME/gcc-4.0.1/bin/g++ -c friend.cc
friend.cc: In constructor 'Foo::A::A()':
friend.cc:9: error: 'Foo::Bar::B::B()' is private
friend.cc:15: error: within this context

-- 
           Summary: friend in containing namespace is not found
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: assar at kth dot se
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]