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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/49172
2
// { dg-options -std=c++0x }
3
 
4
#define SA(X) static_assert((X),#X)
5
 
6
constexpr int g() { return 42; };
7
constexpr int(&rg)() = g; // #1
8
 
9
SA(rg() == 42);
10
 
11
constexpr int i = 24;
12
constexpr int const& ri = i; // #2
13
 
14
SA(&ri == &i);
15
SA(ri == 24);
16
 
17
void f()
18
{
19
  constexpr int(&rg)() = g; // #1
20
 
21
  SA(rg() == 42);
22
 
23
  constexpr static int i = 24;
24
  constexpr int const& ri = i; // #2
25
 
26
  SA(&ri == &i);
27
  SA(ri == 24);
28
}
29
 
30
template 
31
void f2()
32
{
33
  constexpr int(&rg)() = g; // #1
34
 
35
  SA(rg() == 42);
36
 
37
  constexpr static int i = 24;
38
  constexpr int const& ri = i; // #2
39
 
40
  SA(&ri == &i);
41
  SA(ri == 24);
42
}
43
 
44
template void f2();

powered by: WebSVN 2.1.0

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