Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/warn/Wshadow-5.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// Wshadows was giving warnings for nested function parameters in nested class // or structure that we didn't want. // { dg-do compile } // { dg-options "-Wshadow -Wno-return-type" } // PR c++/41825 int f (int n) { int bar (int n) { return n++; } // { dg-error "a function-definition is not allowed here" } return bar (n); // { dg-error "12:'bar' was not declared in this scope" } } int g (int i) { struct { int bar (int i) { return i++; } // { dg-bogus "shadows" } } s; return s.bar (i); } // PR c++/30566 void h( int x ) { class InnerClass { public: static int g( int x ) // { dg-bogus "shadows" } { // empty } }; }