This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36734] New: Incorrect access to tyedef in base of template class.
- From: "m_albert137 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2008 21:49:25 -0000
- Subject: [Bug c++/36734] New: Incorrect access to tyedef in base of template class.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following compiles, but it shouldn't, because the typedef
in the base is private (c.f. bugs 29040, 33934, 24118). Oddly, if
/Intermediate/ is not a template, this correctly fails to compile.
[By the way, thanks for all the good work.-Mike]
--------------------------------------------------------------------------
class Base
{
typedef int Xtype;
public:
Base( Xtype ){}
};
template<typename T>
class Intermediate : public Base
{
public:
Intermediate(Xtype aVar = Xtype() ) : Base(aVar){}
};
class Derived : public Intermediate<float>
{
public:
Derived(){}
};
int main()
{
Derived derived;
}
--
Summary: Incorrect access to tyedef in base of template class.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: m_albert137 at yahoo dot com
GCC host triplet: x86-64 linux 2.6.22.5-31
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36734