From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,6b2328c812d88b3d,start X-Google-Attributes: gidfa528,public From: lasgoutt@fantomas.inria.fr (Jean-Marc Lasgouttes) Subject: CXX 6.1-027 and pointer-to-member of private classes. Date: 2000/06/23 Message-ID: <8j01g7$t31$1@ites.inria.fr>#1/1 X-Deja-AN: 638099313 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@inria.fr X-Trace: ites.inria.fr 961775943 29793 128.93.11.34 (23 Jun 2000 15:59:03 GMT) Organization: INRIA Rocquencourt Domaine de Voluceau BP 105 - 78153 Le Chesnay Cedex France Mime-Version: 1.0 NNTP-Posting-Date: 23 Jun 2000 15:59:03 GMT Newsgroups: comp.unix.tru64, Hello, I am currently running into problems in the use of the SigC++ library which boild down to the following short example: -------------- template void func(void (T::*f)(int) ) {;} class Foo { private: class Pimpl { void bar(int); Pimpl() { // this is supposed to be the right way func(&Foo::Pimpl::bar); // this almost works, but is not standard func(&bar); } }; }; -------------- When compiling this code with digital C++ 6.1-027 in strict_ansi mode, I get a warning for the second form (as the standard says), but the first one gives me an error: cxx: Error: bug.C, line 9: class "Foo::Pimpl" is inaccessible func(&Foo::Pimpl::bar); -----------------------------------^ However, when compiling with gcc 2.95.2 (-Wall -ansi -pedantic) the first form is accepted without problem. So, is that a bug in this cxx version (and in this case, has it been fixed since then) or should the example program be changed to comply with the standard? Thanks in advance for any help. JMarc -- ------------------------------------------------- Jean-Marc Lasgouttes, Projet MEVAL, INRIA, France e-mail : jean-marc.lasgouttes@inria.fr