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

Subversion Repositories openrisc

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

Compare with Previous | Blame | View Log

// { 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 "" } 






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.