OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [Wshadow-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 2001 Free Software Foundation, Inc.  */
2
 
3
/* { dg-do compile } */
4
/* { dg-options "-Wshadow -pedantic-errors" } */
5
 
6
/* Source: Neil Booth, 5 Dec 2001.  */
7
 
8
int decl1;                      /* { dg-warning "shadowed declaration" } */
9
void foo (double decl1)         /* { dg-warning "shadows a global decl" } */
10
{
11
}
12
 
13
void foo1 (int d)               /* { dg-warning "previous definition" } */
14
{
15
  double d;      /* { dg-bogus "warning" "warning in place of error" } */
16
  /* { dg-error "redeclared as different" "" { target *-*-* } 15 } */
17
}
18
 
19
void foo2 (int d)               /* { dg-warning "shadowed declaration" } */
20
{
21
  {
22
    double d;                   /* { dg-warning "shadows a parameter" } */
23
  }
24
}
25
 
26
void foo3 ()
27
{
28
  int local;                    /* { dg-warning "shadowed declaration" } */
29
  {
30
    int local;                  /* { dg-warning "shadows a previous local" } */
31
  }
32
}

powered by: WebSVN 2.1.0

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