This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14777] New: typedef doesn't fully expose base class type
- From: "mdorey at bluearc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2004 21:09:43 -0000
- Subject: [Bug c++/14777] New: typedef doesn't fully expose base class type
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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