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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [parse/] [pr34758.C] - Rev 693

Compare with Previous | Blame | View Log

// PR 34758 Bad diagnostic for circular dependency in constructor default argument
// { dg-do compile }
// { dg-options "" }
struct A
{
  A (const A& = A()); // { dg-error "recursive evaluation of default argument" }
};


struct S {
  S(const S& = f()); // { dg-error "default argument\[^\n\]*which is not yet defined" }
  static const S& f(int i = 3);
};

struct J {
  J(const J& = f(2)); // { dg-error "default argument.*which is not yet defined" }
  static const J& f(int i = 3, int j = 4);
};

struct Z {
  Z(const Z& = f(4));
  static const Z& f(int i = 3);
};

struct X {
  X(const X& = g());
  static const X& g(void);
};

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.