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++/24654] New: friend class using plain scope resolution operator


The following code must now use the plain scope resolution operator in order to
work with gcc4. Is it a regression or a conformance to the specs?


class Initializer ;

namespace NS {
  class A {
    // Now must use ::Initializer with gcc4 in order to compile
    // If not, the following error occurs:
    //   error: 'static void NS::A::initialize()' is private
    //
    // Using Initializer works with gcc 3.4.3
    friend class ::Initializer ;

    static void initialize() {}
  } ;
}

class Initializer {
public:
  static void initialize() { NS::A::initialize() ; }
} ;


int main() {
  Initializer::initialize() ;
  return 0 ;
}


Frantz


-- 
           Summary: friend class using plain scope resolution operator
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fmaerten at igeoss dot com


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


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