URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [partial6.C] - Rev 801
Go to most recent revision | Compare with Previous | Blame | View Log
// PR c++/41703
// The second GetAllSize template is more specialized because even though
// deduction on each parameter type succeeds, we never get a template
// argument for its X to make it match the first template.
template <typename T, int (T::*)() const>
struct TSizeEnabler
{
typedef T TClass;
};
template <typename X>
int
GetAllSize(const X &Var)
{ return sizeof(Var); }
template <typename X>
int
GetAllSize(const typename TSizeEnabler<X, &X::func>::TClass &Var)
{ return Var.func(); }
struct H
{
int func() const;
};
int main()
{
H b;
return GetAllSize< H >(b);
}
Go to most recent revision | Compare with Previous | Blame | View Log