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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-47570.C] - Blame information for rev 717

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/47570
2
// { dg-options -std=c++0x }
3
 
4
unsigned int constexpr one()
5
{ return 1; }
6
 
7
int constexpr one_B()
8
{ return 1; }
9
 
10
int main()
11
{
12
  // FAIL TO COMPILE:
13
  static bool constexpr SC_huh1 = ((unsigned int)one()) >= ((unsigned int)0);
14
  static bool constexpr SC_huh2 = one() >= ((unsigned int)0);
15
  static bool constexpr SC_huh3 = one() >= 0;
16
 
17
  // COMPILE OK:
18
  static bool constexpr SC_huh4 = ((one() == 0) || (one() > 0));
19
  static bool constexpr SC_huh5 = one() == 0;
20
  static bool constexpr SC_huh6 = one() > 0;
21
  static bool constexpr SC_huh7 = one_B() >= 0;
22
  static bool constexpr SC_huh8 = one() >= 1;
23
 
24
  return SC_huh3;
25
}

powered by: WebSVN 2.1.0

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