Commit b4c20e52 by Mark Mitchell Committed by Mark Mitchell

decl.c (cp_finish_decl): Correct check for dynamic initialization of thread-local storage.

	* decl.c (cp_finish_decl): Correct check for dynamic
	initialization of thread-local storage.

	* g++.dg/tls/init-2.C: Tweak error messages.

From-SVN: r57696
parent 871e97f7
2002-10-01 Mark Mitchell <mark@codesourcery.com>
* decl.c (cp_finish_decl): Correct check for dynamic
initialization of thread-local storage.
2002-09-30 Nathan Sidwell <nathan@codesourcery.com>
* tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also
......
......@@ -8218,6 +8218,13 @@ cp_finish_decl (decl, init, asmspec_tree, flags)
&& (!DECL_EXTERNAL (decl) || init))
{
init = check_initializer (decl, init);
/* Thread-local storage cannot be dynamically initialized. */
if (DECL_THREAD_LOCAL (decl) && init)
{
error ("`%D' is thread-local and so cannot be dynamically "
"initialized", decl);
init = NULL_TREE;
}
/* If DECL has an array type without a specific bound, deduce the
array size from the initializer. Note that this must be done
after check_initializer is called because of cases like this:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment