URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [sfinae6.C] - Rev 693
Compare with Previous | Blame | View Log
// PR c++/48113
// { dg-options -std=c++0x }
template<typename T> T declval();
struct tuple { };
struct F1
{
void operator()(tuple, int);
};
typedef void (*F2)(tuple, int);
template<typename F, typename T>
struct Bind
{
template<typename A,
typename R = decltype( F()(declval<T&>(), A()) )>
R f(A);
template<typename A,
typename R = decltype( F()(declval<volatile T&>(), A()) )>
R f(A) volatile;
};
int main()
{
Bind<F1, tuple>().f(0); // OK
Bind<F2, tuple>().f(0); // ERROR, should be OK
}