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
  2004-03-29 21:19 ` [Bug c++/14777] [3.4/3.5 regression] " bangerth at dealii dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ 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] 10+ messages in thread

end of thread, other threads:[~2005-09-27 15:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-29 21:09 [Bug c++/14777] New: typedef doesn't fully expose base class type mdorey at bluearc dot com
2004-03-29 21:19 ` [Bug c++/14777] [3.4/3.5 regression] " bangerth at dealii dot org
2004-06-05 19:51 ` mmitchel at gcc dot gnu dot org
2004-06-07 15:52 ` cvs-commit at gcc dot gnu dot org
2004-06-07 15:54 ` cvs-commit at gcc dot gnu dot org
2004-06-07 16:24 ` mmitchel at gcc dot gnu dot org
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).