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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wshadow-5.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Wshadows was giving warnings for nested function parameters in nested class
2
// or structure that we didn't want.
3
// { dg-do compile }
4
// { dg-options "-Wshadow" }
5
 
6
// PR c++/41825
7
int f (int n)
8
{
9
    int bar (int n) { return n++; } // { dg-error "a function-definition is not allowed here" }
10
    return bar (n); // { dg-error "was not declared in this scope" }
11
}
12
 
13
int g (int i)
14
{
15
    struct {
16
        int bar (int i) { return i++; } // { dg-bogus "shadows" }
17
    } s;
18
 
19
    return s.bar (i);
20
}
21
 
22
// PR c++/30566
23
void h( int x )
24
{
25
  class InnerClass
26
    {
27
      public:
28
              static int g( int x ) // { dg-bogus "shadows" }
29
                {
30
                  // empty
31
                }
32
    };
33
}

powered by: WebSVN 2.1.0

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