aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-01-28 17:36:11 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-01-28 17:36:11 +0000
commitf2ce60b88d09c376e9862b78e5d37045b2e92351 (patch)
tree6b16cc4f776bde31d9b1c094a319842c484192b3 /gcc/cp
parentf42aadd8561dc4c3da4843536a5f9a0af142c26d (diff)
downloadgcc-f2ce60b88d09c376e9862b78e5d37045b2e92351.zip
gcc-f2ce60b88d09c376e9862b78e5d37045b2e92351.tar.gz
gcc-f2ce60b88d09c376e9862b78e5d37045b2e92351.tar.bz2
re PR c++/3902 ([parser] ambiguous 8.2/7)
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 180fccb..09445a06 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+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.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7e172ab..1561f4c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6518,8 +6518,8 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
{
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;