https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94553
Bug ID: 94553 Summary: Revisit [basic.scope.declarative]/4.2 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- <http://eel.is/c++draft/basic.scope#declarative-4.2> has a note: A structured binding ([dcl.struct.bind]), namespace name ([basic.namespace]), or class template name ([temp.pre]) must be unique in its declarative region. but we don't fully implement that. Consequently, the following is accepts-valid. (The structured binding part was added in CWG 2289.) void f () { int arr[1] = { 1 }; struct A { }; auto [A] = arr; // error auto [B] = arr; struct B { }; // error } struct C { }; template<typename> int C; // error template<typename> int D; struct D { }; // error