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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/44908
2
// { dg-options "-std=c++0x" }
3
 
4
#include 
5
 
6
struct A { };
7
 
8
struct B
9
: public virtual A { };
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 decltype(test_aux(std::declval()), one())
22
      test(int);
23
 
24
    template
25
      static two test(...);
26
 
27
    public:
28
      static const bool value = sizeof(test(0)) == 1;
29
  };
30
 
31
template
32
  const bool mini_is_convertible::value;
33
 
34
static_assert (!mini_is_convertible
35
               int (A::*) (int)>::value, "");
36
static_assert (!mini_is_convertible::value, "");
37
static_assert (!mini_is_convertible
38
               int (B::*) (int)>::value, "");
39
static_assert (!mini_is_convertible::value, "");

powered by: WebSVN 2.1.0

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