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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [friend.C] - Rev 801

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

// Contribued by Gabriel Dos Reis <gdr@codesourcery.com>
// Origin: iskey@i100.ryd.student.liu.se

class ostream;
extern ostream& cout;

template <class T> struct s;

template <class T>
ostream& operator<<(ostream &o, const typename s<T>::t &x) // { dg-message "note" }
{
  return o;
}

template <class T>
struct s {
  struct t
  {
    friend ostream&
    operator<<<T>(ostream&, const typename s<T>::t &);
  };
  t x;
};

int main()
{
  s<int>::t y;
  cout << y; // { dg-error "" }
  // { dg-message "(candidate|deduce template parameter)" "candidate note" { target *-*-* } 28 }
}

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.