2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / template5.C
blob8401eafa90de13e6173ebc89b76e88f0c1814e74
1 // { dg-do assemble  }
2 // Bug: g++ fails to compare integer constants properly.
4 template <int X, int Y>
5 struct Matrix {
6    int base [X] [Y];
7 };
9 template <int M,int H,int N>
10 Matrix<M,N>& Mul(Matrix<M,N>& Q,Matrix<M,H>& A,Matrix<H,N>& B) {
11   for(int i=0;i<M;i++) {
12     for(int j=0;j<N;j++) {
13       Q.base[i][j]=0;
14       for(int k=0;k<H;k++) {
15         Q.base[i][j]+=A.base[i][k]*B.base[k][j];
16       }
17     }
18   }
19   return Q;
22 void f ()
24    Matrix<2, 3> q;
25    Matrix<2, 4> a;
26    Matrix<4, 3> b;
27    q = Mul (q, a, b);