re PR c++/66808 (tree check fail in symbol_table::decl_assembler_name_hash)

PR c++/66808
	PR c++/69000
	* pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.

	* g++.dg/tls/pr66808.C: New test.
	* g++.dg/tls/pr69000.C: New test.

From-SVN: r232259
This commit is contained in:
Jakub Jelinek 2016-01-12 09:21:53 +01:00 committed by Jakub Jelinek
parent 3df6ff355f
commit 723033a6b2
5 changed files with 49 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2016-01-12 Jakub Jelinek <jakub@redhat.com>
PR c++/66808
PR c++/69000
* pt.c (tsubst_decl): If not local_p, clear DECL_TEMPLATE_INFO.
2016-01-11 Jason Merrill <jason@redhat.com>
PR c++/69131

View File

@ -12292,8 +12292,13 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
SET_DECL_IMPLICIT_INSTANTIATION (r);
register_specialization (r, gen_tmpl, argvec, false, hash);
}
else if (!cp_unevaluated_operand)
register_local_specialization (r, t);
else
{
if (DECL_LANG_SPECIFIC (r))
DECL_TEMPLATE_INFO (r) = NULL_TREE;
if (!cp_unevaluated_operand)
register_local_specialization (r, t);
}
DECL_CHAIN (r) = NULL_TREE;

View File

@ -1,3 +1,10 @@
2016-01-12 Jakub Jelinek <jakub@redhat.com>
PR c++/66808
PR c++/69000
* g++.dg/tls/pr66808.C: New test.
* g++.dg/tls/pr69000.C: New test.
2016-01-11 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/swaps-p8-23.c: New test.

View File

@ -0,0 +1,10 @@
// PR c++/66808
// { dg-do compile { target c++11 } }
// { dg-require-effective-target tls }
template <typename>
class A {
int *b = foo ();
int *foo () { static __thread int a; return &a; }
};
A<int> b;

View File

@ -0,0 +1,19 @@
// PR c++/69000
// { dg-do compile }
// { dg-require-effective-target tls }
class A {};
template <typename T>
struct B
{
static int *& foo () { static __thread int *c = 0; return c; }
};
B<A> d;
void
bar ()
{
d.foo ();
}