From 4806765ec47c11611b78a58908db872b1600e45f Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 14 Feb 2001 13:58:49 +0000 Subject: [PATCH] optional parens around connstructor names From-SVN: r39681 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/parse.y | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e86e9fbf62c..23d90952bd2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2001-02-08 Aldy Hernandez + + * cp/parse.y (component_constructor_declarator): allow optional + parenthesess around constructor class name. + 2001-02-14 Nathan Sidwell * cp-tree.h (setup_vtbl_ptr): Move prototype to semantics.c diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index a9963ee7691..59ad4e61064 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -816,11 +816,19 @@ fn.def1: YYERROR1; } ; +/* ANSI allows optional parentheses around constructor class names. + See ISO/IEC 14882:1998(E) 12.1. */ + component_constructor_declarator: - SELFNAME '(' parmlist ')' cv_qualifiers exception_specification_opt - { $$ = make_call_declarator ($1, $3, $5, $6); } - | SELFNAME LEFT_RIGHT cv_qualifiers exception_specification_opt - { $$ = make_call_declarator ($1, empty_parms (), $3, $4); } + SELFNAME '(' parmlist ')' cv_qualifiers exception_specification_opt + { $$ = make_call_declarator ($1, $3, $5, $6); } + | '(' SELFNAME ')' '(' parmlist ')' cv_qualifiers + exception_specification_opt + { $$ = make_call_declarator ($2, $5, $7, $8); } + | SELFNAME LEFT_RIGHT cv_qualifiers exception_specification_opt + { $$ = make_call_declarator ($1, empty_parms (), $3, $4); } + | '(' SELFNAME ')' LEFT_RIGHT cv_qualifiers exception_specification_opt + { $$ = make_call_declarator ($2, empty_parms (), $5, $6); } | self_template_type '(' parmlist ')' cv_qualifiers exception_specification_opt { $$ = make_call_declarator ($1, $3, $5, $6); } | self_template_type LEFT_RIGHT cv_qualifiers exception_specification_opt -- 2.30.2