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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-array-ptr6.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
// { dg-options "-std=c++0x" }
2
 
3
typedef decltype(sizeof(char)) size_type;
4
 
5
template
6
constexpr size_type size(T (&)[N]) { return N; }
7
 
8
double array_double[] = { 1.0, 2.0, 3.0 };
9
 
10
constexpr auto sz_d = size(array_double);
11
 
12
static_assert(sz_d == 3, "Array size failure");
13
 
14
void f(bool (¶m)[2]) {
15
  static_assert(size(param) == 2, "Array size failure"); // Line 13
16
  short data[] = {-1, 2, -45, 6, 88, 99, -345};
17
  static_assert(size(data) == 7, "Array size failure");
18
}

powered by: WebSVN 2.1.0

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