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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-base.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
// Test base/member class and static_assert with constexpr
2
// { dg-options -std=c++0x }
3
 
4
struct A {
5
  int i;
6
  constexpr A(int _i): i(_i) { }
7
};
8
struct B: A {
9
  A a;
10
  int j;
11
  constexpr B(int _ib, int _ia, int _j): A(_ib), a(_ia), j(_j) { }
12
};
13
 
14
constexpr B b (12, 24, 36);
15
 
16
#define SA(X) static_assert (X, #X)
17
SA(b.i==12 && b.a.i==24 && b.j==36);

powered by: WebSVN 2.1.0

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