This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

parenthesess around constructor class name


yet another silly ansi-ism.  Jason has said it's ok.

aldy

2001-02-08  Aldy Hernandez  <aldyh@redhat.com>

        * cp/parse.y (component_constructor_declarator): allow optional
        parenthesess around constructor class name.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/parse.y,v
retrieving revision 1.213
diff -c -p -r1.213 parse.y
*** parse.y	2001/02/12 14:29:08	1.213
--- parse.y	2001/02/13 22:52:59
*************** fn.def1:
*** 816,826 ****
  		    YYERROR1; }
  	;
  
  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); }
  	| 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
--- 816,834 ----
  		    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 ')' '(' 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]