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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [constexpr-using.C] - Rev 774

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

// Core issue 898
// { dg-options -std=c++0x }

namespace N { const int i = 42; }
namespace M { const int j = 42; }

constexpr int g() {
  using namespace N;
  using M::j;
  static_assert (i == 42, "i == 42");
  return i + j;
}

template <class T>
constexpr int h() {
  using namespace N;
  using M::j;
  static_assert (i == 42, "i == 42");
  return i + j;
}

constexpr int i = g();
constexpr int i2 = h<int>();

static_assert (i == 84, "i == 84");
static_assert (i2 == 84, "i2 == 84");

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.