OSDN Git Service

optional parens around connstructor names
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Feb 2001 13:58:49 +0000 (13:58 +0000)
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Feb 2001 13:58:49 +0000 (13:58 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39681 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/parse.y

index e86e9fb..23d9095 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-08  Aldy Hernandez  <aldyh@redhat.com>
+
+        * cp/parse.y (component_constructor_declarator): allow optional
+        parenthesess around constructor class name.
+
 2001-02-14  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cp-tree.h (setup_vtbl_ptr): Move prototype to semantics.c
index a9963ee..59ad4e6 100644 (file)
@@ -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