public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14777] New: typedef doesn't fully expose base class type
@ 2004-03-29 21:09 mdorey at bluearc dot com
  2005-03-09  4:45 ` [Bug c++/14777] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: mdorey at bluearc dot com @ 2004-03-29 21:09 UTC (permalink / raw)
  To: gcc-bugs

template <typename T>
struct B
{
protected:
  typedef int M;
};

template <typename T>
struct A : B<T> {
  typedef typename B<T>::M N;
  A (int = N ());
};

A<int> a = A<int> ();

Produces:

Connection.cpp:5: error: `typedef int B<int>::M' is protected
Connection.cpp:14: error: within this context

With recent snapshots (eg gcc 3.4.0 20040324 - can send full version guff if it
wouldn't just be more clutter for you to read).  Sorry, that's as simple as I
managed to make the example - I did try everything I could think of to simplify
it further.

Interestingly, or perhaps not, this does compile when I think it shouldn't. 
It's the same thing except for char instead of int in the typedef for N.

template <typename T>
struct B
{
protected:
  typedef int M;
};

template <typename T>
struct A : B<T> {
  typedef typename B<char>::M N;
  A (int = N ());
};

A<int> a = A<int> ();

-- 
           Summary: typedef doesn't fully expose base class type
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mdorey at bluearc dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-11-23 15:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-14777-28@http.gcc.gnu.org/bugzilla/>
2005-10-30 22:16 ` [Bug c++/14777] [3.4/4.0/4.1 Regression] typedef doesn't fully expose base class type mmitchel at gcc dot gnu dot org
2006-03-11  3:20 ` [Bug c++/14777] [3.4/4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
2007-01-18  2:52 ` [Bug c++/14777] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
2007-01-21 21:19 ` pinskia at gcc dot gnu dot org
2007-02-14  9:29 ` mmitchel at gcc dot gnu dot org
2008-07-04 16:31 ` [Bug c++/14777] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-03-31 16:16 ` [Bug c++/14777] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:27 ` rguenth at gcc dot gnu dot org
2009-11-13  5:41 ` jason at gcc dot gnu dot org
2009-11-13  7:55 ` dodji at seketeli dot org
2009-11-13 10:37 ` dodji at gcc dot gnu dot org
2009-11-13 15:08 ` mark at codesourcery dot com
2009-11-16 21:35 ` dodji at gcc dot gnu dot org
2009-11-16 22:13 ` dodji at seketeli dot org
2009-11-23 13:30 ` dodji at gcc dot gnu dot org
2009-11-23 13:44 ` [Bug c++/14777] [4.3/4.4/ " dodji at gcc dot gnu dot org
2009-11-23 13:46 ` dodji at gcc dot gnu dot org
2009-11-23 15:41 ` jason at gcc dot gnu dot org
2004-03-29 21:09 [Bug c++/14777] New: " mdorey at bluearc dot com
2005-03-09  4:45 ` [Bug c++/14777] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-05-19 17:22 ` mmitchel at gcc dot gnu dot org
2005-07-22 21:12 ` pinskia at gcc dot gnu dot org
2005-09-27 15:58 ` mmitchel 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).