https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78842
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2016-12-17 CC| |jakub at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- This is not a self-contained testcase, please include either a preprocessed source, or reduced self-contained testcase. There are several cases in the C++ FE that errors out rather than just warns about shadowing, e.g. void foo1 (int d) { double d; // { dg-error "shadows a parameter" } } is an error rather than warning, template <typename t> // { dg-message "template parameter" } void f() { int t = 1; // { dg-error "shadows" } } as well, while void foo2 (int d) { { double d; // { dg-warning "shadows a parameter" } } } is a warning. I haven't looked up the standard where it says the first case is invalid, but as from your snippet is unclear what is going on, it would be a waste of time.