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-ptr7.C] - Rev 774

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

// PR c++/49290
// { dg-options -std=c++0x }

typedef unsigned T;
struct S
{
  constexpr T foo (void);
  unsigned s1[16];
};

constexpr T
S::foo ()
{
  return *(T *) (s1 + 10);
}

constexpr S s = { 0,1,2,3,4,5,6,7,8,9,10 };

#define SA(X) static_assert ((X), #X)
SA(s.foo() == 10);

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

powered by: WebSVN 2.1.0

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