http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56947
Bug #: 56947 Summary: [4.7.3 regression] Bogus 'XX' was not declared in this scope Classification: Unclassified Product: gcc Version: 4.7.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ppluzhni...@google.com This is a recent gcc-4_7-branch regression. The case builds with trunk (r197936), fails with 4.7 branch (r197941): struct A { A (int); }; template < typename > void Fn () { const int kCapacity = 0; struct Q:A { Q ():A (kCapacity) { } }; Q q; } template void Fn < int >(); $ trunk/bin/g++ -c t.cc && echo ok ok $ 4.7/bin/g++ -c t.cc t.cc: In instantiation of ‘Fn()::Q::Q() [with <template-parameter-1-1> = int]’: t.cc:14:7: required from ‘void Fn() [with <template-parameter-1-1> = int]’ t.cc:16:26: required from here t.cc:12:26: error: ‘kCapacity’ was not declared in this scope