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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/44908
2
 
3
struct A { };
4
 
5
struct B
6
: public virtual A { };
7
 
8
template struct enable_if { typedef T type; };
9
template struct enable_if { };
10
 
11
template
12
  class mini_is_convertible
13
  {
14
    typedef char one;
15
    typedef struct { char arr[2]; } two;
16
 
17
    template
18
      static void test_aux(To1);
19
 
20
    template
21
      static typename
22
      enable_if<(sizeof(test_aux(From1()), 1) > 0), one>::type
23
      test(int);
24
 
25
    template
26
      static two test(...);
27
 
28
    public:
29
      static const bool value = sizeof(test(0)) == 1;
30
  };
31
 
32
template
33
  const bool mini_is_convertible::value;
34
 
35
int Test1[mini_is_convertible
36
          int (A::*) (int)>::value ? -1 : 1];
37
int Test2[mini_is_convertible::value ? -1 : 1];
38
int Test3[mini_is_convertible
39
          int (B::*) (int)>::value ? -1 : 1];
40
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.