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
This commit is contained in:
parent
b8dd691344
commit
f8aa3dd388
3 changed files with 13 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
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,8 +4825,11 @@ start_decl (const cp_declarator *declarator,
|
|||
|
||||
was_public = TREE_PUBLIC (decl);
|
||||
|
||||
/* Enter this declaration into the symbol table. */
|
||||
decl = maybe_push_decl (decl);
|
||||
/* 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)
|
||||
decl = push_template_decl (decl);
|
||||
|
|
5
gcc/testsuite/g++.dg/cpp1y/var-templ24.C
Normal file
5
gcc/testsuite/g++.dg/cpp1y/var-templ24.C
Normal file
|
@ -0,0 +1,5 @@
|
|||
// { dg-do compile { target c++14 } }
|
||||
|
||||
template <class T> bool Foo = Foo<int>;
|
||||
template <> bool Foo<int> = true;
|
||||
int i = Foo<char>;
|
Loading…
Add table
Reference in a new issue