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

Subversion Repositories openrisc

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

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

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

struct A { A(); };

struct B {
  friend constexpr int f(B) { return 0; } // OK
  friend constexpr int f(A) { return 0; } // { dg-error "constexpr" }
};

template <class T>
struct C
{
  friend constexpr int f(C) { return 0; }
  friend constexpr int g(C, A) { return 0; } // { dg-error "double" }
  constexpr int m(C) { return 0; }
  constexpr int m(A) { return 0; } // { dg-error "double" }
};

constexpr int i = f(C<int>());
constexpr int j = C<int>().m(C<int>());
constexpr int k = C<double>().m(A()); // { dg-error "constexpr" }
constexpr int l = g(C<double>(),A()); // { dg-error "constexpr" }

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.