https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100608
Bug ID: 100608 Summary: [10/11/12 Regression] -Wshadow=compatible-local false positive: function local type declaration shadows variable of different type Product: gcc Version: 10.3.1 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nok.raven at gmail dot com Target Milestone: --- template <typename> class X {}; void foo() { auto a = X<class a>{}; } <source>: In function 'void foo()': <source>:5:22: warning: declaration of 'struct foo()::a' shadows a previous local [-Wshadow=compatible-local] 5 | auto a = X<class a>{}; | ^ <source>:5:10: note: shadowed declaration is here 5 | auto a = X<class a>{}; | ^ https://godbolt.org/z/hzoro9v3Y