Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/warn/Wshadow-16.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
// PR c++/91868 - improve -Wshadow location. // { dg-options "-Wshadow" } int global; // { dg-message "shadowed declaration" } struct S { static int bar; // { dg-message "shadowed declaration" } S (int i) { int bar // { dg-warning "19:declaration of .bar. shadows a member" } (1); int global // { dg-warning "9:declaration of .global. shadows a global declaration" } (42); } }; void foo () { int xx; // { dg-message "shadowed declaration" } { S xx // { dg-warning "7:declaration of .xx. shadows a previous local" } (42); } }