Commit f8aa3dd3 by Jason Merrill Committed by Jason Merrill

decl.c (start_decl): Don't push the plain VAR_DECL for a variable template.

	* decl.c (start_decl): Don't push the plain VAR_DECL for a
	variable template.

From-SVN: r222837
parent b8dd6913
2015-05-05 Jason Merrill <jason@redhat.com>
* decl.c (start_decl): Don't push the plain VAR_DECL for a
variable template.
DR 1518
DR 1630
PR c++/54835
......
......@@ -4825,7 +4825,10 @@ start_decl (const cp_declarator *declarator,
was_public = TREE_PUBLIC (decl);
/* Enter this declaration into the symbol table. */
/* Enter this declaration into the symbol table. Don't push the plain
VAR_DECL for a variable template. */
if (!template_parm_scope_p ()
|| TREE_CODE (decl) != VAR_DECL)
decl = maybe_push_decl (decl);
if (processing_template_decl)
......
// { dg-do compile { target c++14 } }
template <class T> bool Foo = Foo<int>;
template <> bool Foo<int> = true;
int i = Foo<char>;
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