This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18061] New: Problem with template class
- From: "ycollet at freesurf dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2004 16:46:48 -0000
- Subject: [Bug c++/18061] New: Problem with template class
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When I compile this sample (g++ main.cpp -o main)
g++ says that A_val is not defined !
It uses to work with g++ version < 3.4
A.hpp ------------------------
template <typename Var>
class A
{
public:
double getA() {return A_val;}
protected:
double A_val;
};
B.hpp ---------------------------
#include "A.hpp"
template<typename Var>
class B : public A<Var>
{
public:
double getB() {return A_val;}
protected:
double B_val;
};
main.cpp ----------------
#include "B.hpp"
int main()
{
B<int> test;
test.getA();
return 0;
}
--------
--
Summary: Problem with template class
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ycollet at freesurf dot fr
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: linux i686 gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18061