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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// The conversion from D* to B* is ambiguous, but that should not produce
2
// an error, it should remove the first f overload by SFINAE.
3
 
4
#define static_assert(TEST,STR) \
5
  do { int ar[(TEST)?1:-1]; } while (0);
6
 
7
struct B {};
8
 
9
struct B1 : B {};
10
struct B2 : B {};
11
 
12
struct D : B1, B2 {};
13
 
14
template  T create();
15
 
16
typedef char one[1];
17
typedef char two[2];
18
 
19
template 
20
    one &f(char (*)[sizeof static_cast(create())]);
21
template 
22
    two &f(...);
23
 
24
int main()
25
{
26
  static_assert(sizeof f(0) == sizeof(two), "");
27
  static_assert(sizeof f(0) == sizeof(two), "");
28
}

powered by: WebSVN 2.1.0

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