http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58940
Bug ID: 58940 Summary: [C++11] Bogus "error: use of deleted function ..." Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Google ref: b/11457051 Using g++ (GCC) 4.9.0 20131028 (experimental) g++ -c -std=c++11 t.cc t.cc: In constructor 'constexpr B<int>::B()': t.cc:7:32: error: use of deleted function 'A< <template-parameter-1-1> >::A(const A< <template-parameter-1-1> >&) [with <template-parameter-1-1> = int]' template < typename X > struct B ^ t.cc:3:5: note: declared here A (A const &) = delete; ^ t.cc: At global scope: t.cc:12:10: note: synthesized method 'constexpr B<int>::B()' first required here B < int >b; ^ Compiles with Clang. Probably same root cause as in PR58930. Test case: // --- template < typename > struct A { A (A const &) = delete; A (int); }; template < typename X > struct B { A < X > a { 0 }; }; B < int >b; // ---