https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119631
Bug ID: 119631 Summary: [rejects-valid] erroneous "was not declared in this scope" in partial specialization of nested class template Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eric.niebler at gmail dot com Target Milestone: --- the following code is rejected by gcc trunk. as far as i can tell, it has never worked. template <class T> struct outer { template <T... Xs> struct inner; template <T X> struct inner<X> { T x = X; }; }; result: <source>:8:11: error: 'X' was not declared in this scope [-Wtemplate-body] 8 | T x = X; | ^ repro: https://godbolt.org/z/GeG973nb1