re PR c++/61445 ([C++11] ice in instantiate_decl at cp/pt.c:19770)

PR c++/61445
	PR c++/56947
	* pt.c (instantiate_decl): Don't check defer_ok for local class
	members.

From-SVN: r212524
This commit is contained in:
Jason Merrill 2014-07-14 16:39:35 -04:00 committed by Jason Merrill
parent d8e11262f0
commit d110c52ee3
3 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2014-07-14 Jason Merrill <jason@redhat.com>
PR c++/61445
PR c++/56947
* pt.c (instantiate_decl): Don't check defer_ok for local class
members.
2014-07-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/61294

View File

@ -19775,11 +19775,6 @@ instantiate_decl (tree d, int defer_ok,
if (external_p && !always_instantiate_p (d))
return d;
/* Any local class members should be instantiated from the TAG_DEFN
with defer_ok == 0. */
gcc_checking_assert (!defer_ok || !decl_function_context (d)
|| LAMBDA_TYPE_P (DECL_CONTEXT (d)));
gen_tmpl = most_general_template (tmpl);
gen_args = DECL_TI_ARGS (d);

View File

@ -0,0 +1,15 @@
// PR c++/61445
template <typename T> void f (T)
{
struct A
{
struct B { B(); };
void g () { B b; }
};
}
int main()
{
f(0);
}