URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [fntype1.C] - Rev 749
Go to most recent revision | Compare with Previous | Blame | View Log
bool f(int i) { return i != 5; }
template <class X, class P = bool(X)>
struct Traits
{
typedef P type;
};
template <class X, class P = typename Traits<X>::type>
struct S
{
const P& p_;
S( const P& p ) : p_(p) {} // const reference
};
template <class X>
S<X> make_s(const typename Traits<X>::type & p) // const reference
{
return S<X>(p); // << HERE
}
int main()
{
make_s<int>(f);
}
Go to most recent revision | Compare with Previous | Blame | View Log