public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33934]  New: access control bug in member function templates
@ 2007-10-28 21:05 sutambe at yahoo dot com
  2007-11-05  0:05 ` [Bug c++/33934] " sutambe at yahoo dot com
  2009-04-29  7:05 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: sutambe at yahoo dot com @ 2007-10-28 21:05 UTC (permalink / raw)
  To: gcc-bugs

In the program snippet given below, line number 14 and 20 should have identical
access privileges with respect to A::func(). But gcc 4.1.2 compiles line #14
just fine, whereas on line #20, it catches the error correctly. This bug is
similar to bug #24118.

  1 class A
  2 {
  3   protected:
  4     void func ()
  5     { }
  6 };
  7
  8 class B: private A
  9 {
 10   public:
 11   template <class T>
 12   void foo ()
 13   {
 14     void (A::*ptr)() = & A::func;
 15    // Should not compile but compiles on gcc 4.1.2
 16   }
 17
 18   void bar ()
 19   {
 20     void (A::*ptr)() = & A::func;
 21     // Should not compile and gcc throws error.
 22   }
 23 };
 24 int main (void)
 25 {
 26   B b;
 27   b.foo<int>();
 28   b.bar();
 29 }


-- 
           Summary: access control bug in member function templates
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sutambe at yahoo dot com
  GCC host triplet: SMP i686  i386 GNU/Linux Fedora Core Release 6
GCC target triplet: SMP i686 i386 GNU/Linux


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/33934] access control bug in member function templates
  2007-10-28 21:05 [Bug c++/33934] New: access control bug in member function templates sutambe at yahoo dot com
@ 2007-11-05  0:05 ` sutambe at yahoo dot com
  2009-04-29  7:05 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: sutambe at yahoo dot com @ 2007-11-05  0:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from sutambe at yahoo dot com  2007-11-05 00:04 -------
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/33934] access control bug in member function templates
  2007-10-28 21:05 [Bug c++/33934] New: access control bug in member function templates sutambe at yahoo dot com
  2007-11-05  0:05 ` [Bug c++/33934] " sutambe at yahoo dot com
@ 2009-04-29  7:05 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-29  7:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2009-04-29 07:05 -------


*** This bug has been marked as a duplicate of 16617 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-29  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-28 21:05 [Bug c++/33934] New: access control bug in member function templates sutambe at yahoo dot com
2007-11-05  0:05 ` [Bug c++/33934] " sutambe at yahoo dot com
2009-04-29  7:05 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).