view gcc/testsuite/gcc.dg/Wshadow-4.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-Wshadow -Wsystem-headers" } */

#include "Wshadow-4.h"
extern void index2 (void); /* { dg-message "declaration is here" } */

void foo (double index1,
	  double index2)
{
}

void foo1 (void)
{
  double index1;
  double index2;
}

void foo2 (void)
{
  {
    double index1;
    double index2;
  }
}

void foo3 (void)
{
  void (*index1)(void); /* { dg-warning "shadows" } */
  void (*index2)(void); /* { dg-warning "shadows" } */
}

void foo4 (void)
{
  void index1(void) {}; /* { dg-warning "shadows" } */
  void index2(void) {}; /* { dg-warning "shadows" } */
}

/* { dg-message "declaration is here" "" { target *-*-* } 0 } */