re PR c++/65646 (ICE in invalid syntax)

PR c++/65646
	* decl.c (grokvardecl): Don't call check_explicit_specialization
	for non-template members of a class template.

From-SVN: r221810
This commit is contained in:
Jason Merrill 2015-04-01 12:36:50 -04:00 committed by Jason Merrill
parent b6dd42a9a8
commit f87cb0b734
3 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2015-04-01 Jason Merrill <jason@redhat.com>
PR c++/65646
* decl.c (grokvardecl): Don't call check_explicit_specialization
for non-template members of a class template.
2015-04-01 Marek Polacek <polacek@redhat.com>
PR c++/65554

View File

@ -8210,7 +8210,9 @@ grokvardecl (tree type,
DECL_INTERFACE_KNOWN (decl) = 1;
// Handle explicit specializations and instantiations of variable templates.
if (orig_declarator)
if (orig_declarator
/* For GCC 5 fix 65646 this way. */
&& current_tmpl_spec_kind (template_count) != tsk_none)
decl = check_explicit_specialization (orig_declarator, decl,
template_count, 0);

View File

@ -0,0 +1,4 @@
// PR c++/65646
template <typename = int> class A {};
template <> A<> &A<>::a; // { dg-error "" }