+2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/15947
+ * parser.c (cp_parser_template_name): Ctors/dtors never need a
+ template keyword to disambiguate.
+
2004-06-14 Mark Mitchell <mark@codesourcery.com>
PR c++/15096
if (is_declaration
&& !template_keyword_p
&& parser->scope && TYPE_P (parser->scope)
- && dependent_type_p (parser->scope))
+ && dependent_type_p (parser->scope)
+ /* Do not do this for dtors (or ctors), since they never
+ need the template keyword before their name. */
+ && !constructor_name_p (identifier, parser->scope))
{
ptrdiff_t start;
cp_token* token;
/* Explain what went wrong. */
error ("non-template `%D' used as template", identifier);
- error ("(use `%T::template %D' to indicate that it is a template)",
- parser->scope, identifier);
+ inform ("use `%T::template %D' to indicate that it is a template",
+ parser->scope, identifier);
/* If parsing tentatively, find the location of the "<"
token. */
if (cp_parser_parsing_tentatively (parser)
+2004-06-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/15947
+ * g++.dg/parse/dtor4.C: New test.
+
2004-06-14 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/20040614-1.c: New test.
--- /dev/null
+// { dg-do compile }
+// Contributed by Paul Koning <pkoning at equallogic dot com>
+// PR c++/15947: Accept destructor as template in qualified-id
+
+template <int N> struct X {
+ ~X();
+};
+
+template <int N>
+X<N>::~X<N>(){}