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:
parent
d8e11262f0
commit
d110c52ee3
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
15
gcc/testsuite/g++.dg/template/local9.C
Normal file
15
gcc/testsuite/g++.dg/template/local9.C
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user