OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb11.C] - Rev 305

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do assemble  }

template<int N1, int N2>
struct meta_max {
    enum { max = (N1 > N2) ? N1 : N2 };
};

struct X {
    enum {
       a = 0,
       n = 0
    };
};

template<class T1, class T2>
struct Y {

    enum {
       a = T1::a + T2::a,

       // NB: if the next line is changed to
       // n = (T1::n > T2::n) ? T1::n : T2::n
       // the problem goes away.

       n = meta_max<T1::n,T2::n>::max
    };
};

int z = Y<X,X>::a;

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.