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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [temporary2.C] - Rev 749

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

// { dg-do assemble  }
class X // Indentation has been done so to see the similarities.
{
public:
  X() {}                  // { dg-message "note" } referenced below
         X(X& x) {x.i=7;} // { dg-message "note" } Both functions modify the
  void bar(X& x) {x.i=7;} // { dg-message "note" } reference parameter x.
  int i;
};

X foo() { X x; return x; }

int main() 
{
  X   x(foo()); // { dg-error "no match" } Compiler doesn't warn about temporary reference.
  // { dg-message "candidate" "candidate note" { target *-*-* } 15 }
  x.bar(foo()); // { dg-error "no match" } The same mistake is warned about in this case.
  // { dg-message "candidate" "candidate note" { target *-*-* } 17 }
}

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.