Skip to content
Snippets Groups Projects
Commit 2823b4d9 authored by Nathaniel Shead's avatar Nathaniel Shead
Browse files

c++: Ensure DECL_CONTEXT is set for temporary vars [PR114005]


Modules streaming requires DECL_CONTEXT to be set for anything streamed.
This patch ensures that 'create_temporary_var' does set a DECL_CONTEXT
for these variables (such as the backing storage for initializer_lists)
even if not inside a function declaration.

	PR c++/114005

gcc/cp/ChangeLog:

	* init.cc (create_temporary_var): Use current_scope instead of
	current_function_decl.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/pr114005_a.C: New test.
	* g++.dg/modules/pr114005_b.C: New test.

Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
parent b7b387e1
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment