cp:
PR c++/3902
* parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
inside a declarator.
testsuite:
PR c++/3902
* g++.dg/parse/template5.C: New test.
From-SVN: r61987
+2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3902
+ * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor
+ inside a declarator.
+
2003-01-27 Nathan Sidwell <nathan@codesourcery.com>
* class.c (update_vtable_entry_for_fn): Add index parameter.
{
tree decl_specs = NULL_TREE;
bool friend_p = false;
- bool constructor_possible_p = true;
-
+ bool constructor_possible_p = !parser->in_declarator_p;
+
/* Assume no class or enumeration type is declared. */
*declares_class_or_enum = false;
+2003-01-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3902
+ * g++.dg/parse/template5.C: New test.
+
2003-01-28 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/9258
--- /dev/null
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Jan 2003 <nathan@codesourcery.com>
+
+// PR 3902. More type/decl confusion.
+
+template <class T>
+struct S
+{
+ S foo (T (T));
+ S foo (T(const T&));
+};
+
+int main ()
+{
+ S<int> (S<int>::*pf1)(int (int)) = &S<int>::foo;
+ S<int> (S<int>::*pf2)(int (const int&)) = &S<int>::foo;
+}