From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Merrill To: mmitchell@usa.net Cc: Ross Alexander , egcs@cygnus.com, law@cygnus.com Subject: Re: Error in 971122 i686-pc-linux-gnu Date: Fri, 28 Nov 1997 02:23:00 -0000 Message-id: References: <199711280306.QAA11798@stimpy.math.auckland.ac.nz> <199711272141.VAA00141@quickstep.stanford.edu> X-SW-Source: 1997-11/msg00917.html Fri Nov 28 01:58:14 1997 Jason Merrill * pt.c (check_explicit_specialization): Complain about using a template-id for a non-specialization. Fri Nov 28 01:56:35 1997 Bruno Haible * error.c (dump_decl): Handle TEMPLATE_ID_EXPR. Index: error.c =================================================================== RCS file: /cvs/cvsfiles/devo/gcc/cp/error.c,v retrieving revision 1.87 diff -c -r1.87 error.c *** error.c 1997/11/19 19:52:28 1.87 --- error.c 1997/11/28 09:57:11 *************** *** 776,781 **** --- 776,799 ---- } break; + case TEMPLATE_ID_EXPR: + { + tree args; + dump_type (TREE_OPERAND (t, 0), v); + OB_PUTC ('<'); + for (args = TREE_OPERAND (t, 1); args; args = TREE_CHAIN (args)) + { + if (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (args))) == 't') + dump_type (TREE_VALUE (args), 0); + else + dump_expr (TREE_VALUE (args), 0); + if (TREE_CHAIN (args)) + OB_PUTC2 (',', ' '); + } + OB_PUTC ('>'); + } + break; + case LABEL_DECL: OB_PUTID (DECL_NAME (t)); break; Index: pt.c =================================================================== RCS file: /cvs/cvsfiles/devo/gcc/cp/pt.c,v retrieving revision 1.270 diff -c -r1.270 pt.c *** pt.c 1997/11/27 19:25:31 1.270 --- pt.c 1997/11/28 10:18:15 *************** *** 496,507 **** && !processing_explicit_specialization (template_count) && !is_friend) { ! if (!have_def) /* This is not an explicit specialization. It must be an explicit instantiation. */ return 2; else if (pedantic) ! pedwarn ("Explicit specialization not preceeded by `template <>'"); } if (TREE_CODE (declarator) != TEMPLATE_ID_EXPR) --- 496,514 ---- && !processing_explicit_specialization (template_count) && !is_friend) { ! if (!have_def && ! template_header_count) /* This is not an explicit specialization. It must be an explicit instantiation. */ return 2; + else if (template_header_count > template_count + && !processing_specialization) + { + cp_error ("template-id `%D' in declaration of primary template", + declarator); + return 0; + } else if (pedantic) ! pedwarn ("explicit specialization not preceeded by `template <>'"); } if (TREE_CODE (declarator) != TEMPLATE_ID_EXPR)