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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [overload12.C] - Rev 699

Compare with Previous | Blame | View Log

// { dg-do assemble  }
// Origin: Neil Booth <neilb@earthling.net> from bug #27.

struct A{};

struct B:A{};

struct C:B{};

struct CX
{
  C  c;

  operator C&(){return c;}
};

// viable functions for call below
void f(A&);
void f(B&);

int main()
{
  CX cx;
  C  c;

  f(c);   // the standard conversion to B& is better than to A& 

  f(cx);  // after user defined conversion to C&
  // the standard conversion to B& is better than to A& 
}

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.