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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb44.C] - Blame information for rev 305

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

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// spurious 'const' in error.
3
// For egcs-2.91.34, the warning message refers to
4
// class ostream & operator <<(class ostream &, const class Vector &)
5
// Also, the template instantiation does not provide the missing
6
// friend function, the non-template function does
7
 
8
#include 
9
#include 
10
#include 
11
 
12
using namespace std;
13
 
14
template 
15
class Vector
16
{
17
  friend ostream& operator<< (ostream& out, const Vector & vec); // { dg-warning "non-template" "warn" }
18
  // { dg-message "note" "note" { target *-*-* } 17 }
19
};
20
 
21
template 
22
ostream& operator<< (ostream& out,  const Vector & vec)
23
{
24
  abort();  // this should not be called
25
}
26
 
27
template class Vector;
28
template ostream& operator<< (ostream& out,  const Vector &);
29
 
30
ostream& operator<< (ostream& out, const Vector&)
31
{
32
  return out;
33
}
34
 
35
int main()
36
{
37
  Vector vc;
38
  cout << vc;
39
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.