------- Comment #1 from sl at datamyway dot de 2007-02-21 12:27 -------
Sorry for my cut&paste, the files really are:
A.h:
//const int NUM_BYTES = 5;
template<int NUM_BYTES>
class A
{
public:
int mBytes[NUM_BYTES];
};
----
B.h:
#include "A.h"
template<int NUM_BYTES>
class B : public A<NUM_BYTES>
{
public:
int blee() {
mBytes[0]++;
return mBytes[0];
};
};
----
x.cpp:
#include <iostream>
using namespace std;
#include "B.h"
int main (int argc, char* argv[])
{
B<4> *b = new B<4>;
b->blee();
cout << b->blee() << endl;
}
---
makefile:
.SUFFIXES:
all: x
% :: %.cpp
rm -f $@
g++ -ansi -pedantic -Wall -o $@ $^
% :: %.c
rm -f $@
g++ -o $@ $^ -lgmp -lpq
%.o :: %.cpp %.hpp
rm -f $@
g++ -c $< -g
%.o :: %.c
rm -f $@
g++ -c $< -g
---
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30909