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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [partial6.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/41703
2
// The second GetAllSize template is more specialized because even though
3
// deduction on each parameter type succeeds, we never get a template
4
// argument for its X to make it match the first template.
5
 
6
template 
7
struct TSizeEnabler
8
{
9
    typedef T TClass;
10
};
11
 
12
template 
13
int
14
GetAllSize(const X &Var)
15
{ return sizeof(Var); }
16
 
17
template 
18
int
19
GetAllSize(const typename TSizeEnabler::TClass &Var)
20
{ return Var.func(); }
21
 
22
struct H
23
{
24
    int func() const;
25
};
26
 
27
int main()
28
{
29
    H b;
30
    return GetAllSize< H >(b);
31
}

powered by: WebSVN 2.1.0

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