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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [sfinae19.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
// PR c++/44907
2
 
3
struct A { };
4
 
5
struct B
6
: public A { };
7
 
8
struct C
9
: public A { };
10
 
11
struct D
12
: public B, public C { };
13
 
14
template struct enable_if { typedef T type; };
15
template struct enable_if { };
16
 
17
template
18
  class mini_is_convertible
19
  {
20
    typedef char one;
21
    typedef struct { char arr[2]; } two;
22
 
23
    template
24
      static void test_aux(To1);
25
 
26
    template
27
      static typename
28
      enable_if<(sizeof(test_aux(From1()), 1) > 0), one>::type
29
      test(int);
30
 
31
    template
32
      static two test(...);
33
 
34
    public:
35
      static const bool value = sizeof(test(0)) == 1;
36
  };
37
 
38
template
39
  const bool mini_is_convertible::value;
40
 
41
int Test1[mini_is_convertible::value ? -1 : 1];
42
int Test2[mini_is_convertible::value ? -1 : 1];
43
int Test3[mini_is_convertible::value ? -1 : 1];
44
int Test4[mini_is_convertible::value ? -1 : 1];

powered by: WebSVN 2.1.0

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