summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/warn02.C
blob: 248e1ed9ff19519bb27d09771921ac2a352ddad8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// { dg-do assemble  }
// { dg-options "-Wredundant-decls" }
// 980413 bkoz 
// from g++/15307, tests for -Wredundant-decls 
// for friend functions and functions 


extern int foo(const char *);

class A
{
  friend int foo(const char *);
  int a;
};

class B
{
  friend int foo(const char *);
  int foo2() {return b;}
  int b;
};

class C
{
  friend int foo(const char *);
  friend int foo(const char *); // { dg-warning "" } 
  int foo2() {return b;}
  int b;
};

class D
{
public:
  int foo2() {return b;}  // { dg-error "with" } 
  int foo2() {return b;}  // { dg-error "overloaded" } 
  int b;
};

class E
{
public:
  int foo2(); // { dg-error "with" } 
  int foo2(); // { dg-error "overloaded" } 
  int b;
};

extern int foo3(const char *);  // { dg-warning "" } 
extern int foo3(const char *);  // { dg-warning "" }