PR c++/56947
* pt.c (instantiate_decl): Don't defer instantiation of a nested
function.
From-SVN: r211083
+2014-05-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/56947
+ * pt.c (instantiate_decl): Don't defer instantiation of a nested
+ function.
+
2014-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
if the variable has a constant value the referring expression can
take advantage of that fact. */
if (TREE_CODE (d) == VAR_DECL
+ || decl_function_context (d)
|| DECL_DECLARED_CONSTEXPR_P (d))
defer_ok = 0;
--- /dev/null
+// PR c++/56947
+
+struct A
+{
+ A (int);
+};
+
+template < typename >
+void Fn ()
+{
+ const int kCapacity = 0;
+ struct Q:A
+ {
+ Q ():A (kCapacity) { }
+ };
+ Q q;
+}
+template void Fn < int >();