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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Origin: PR c++/46162
2
 
3
struct small_type { char dummy; };
4
struct large_type { char dummy[2]; };
5
 
6
template
7
struct has_foo_member_variable
8
{
9
  template struct tester;
10
  template static small_type has_foo(tester<&U::foo> *);
11
  template static large_type has_foo(...);
12
  static const bool value = (sizeof(has_foo(0)) == sizeof(small_type));
13
};
14
 
15
struct A
16
{
17
  static int foo()
18
  {
19
    return 0;
20
  }
21
};
22
 
23
struct B
24
{
25
  static int foo;
26
};
27
 
28
void
29
bar()
30
{
31
  bool b = has_foo_member_variable::value;
32
}
33
 

powered by: WebSVN 2.1.0

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