warn02.c

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 55 行

C
55
字号
// { 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;}    int foo2() {return b;}  // { dg-error "" }   int b;};class E{public:  int foo2();   int foo2(); // { dg-error "" }   int b;};extern int foo3(const char *);  // { dg-warning "" } extern int foo3(const char *);  // { dg-warning "" } 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?