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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [expr/] [sizeof2.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
// Contributed by Wolfgang Bangerth 
3
// PR c++/9259: Allow non-qualified member calls in sizeof expressions.
4
 
5
template  struct StaticAssert;
6
template <> struct StaticAssert {};
7
 
8
struct S
9
{
10
  static int check ();
11
  static double check2 ();
12
  static const int value = sizeof(check());
13
  static const int value2 = sizeof(check2());
14
};
15
 
16
template 
17
struct T
18
{
19
  static int check ();
20
  static double check2 ();
21
  static const int value = sizeof(check());
22
  static const int value2 = sizeof(check2());
23
};
24
 
25
StaticAssert<(S::value == sizeof(int))> s;
26
StaticAssert<(S::value2 == sizeof(double))> s2;
27
 
28
StaticAssert<(T::value == sizeof(int))> t;
29
StaticAssert<(T::value2 == sizeof(double))> t2;
30
 

powered by: WebSVN 2.1.0

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