c++/2843: parser: __attribute__ on parameter declarations

Mark Mitchell mark@codesourcery.com
Thu Jan 2 20:31:00 GMT 2003


> Mark, I would also appreciate somebody looking at the following report
> which appears to be related to the above problem:
>
> <http://gcc.gnu.org/ml/gcc-patches/2002-12/msg01494.html>.

I checked in this patch to fix the problem.

Tested on i686-pc-linux-gnu, applied on the mainline.

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com
2003-01-02  Mark Mitchell  <mark@codesourcery.com>

	* parser.c (cp_parser_declaration): Accept the __extension__
	keyword before the declaration.

Index: parser.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/parser.c,v
retrieving revision 1.14
diff -c -p -r1.14 parser.c
*** parser.c	2 Jan 2003 19:45:12 -0000	1.14
--- parser.c	2 Jan 2003 20:28:54 -0000
*************** cp_parser_declaration_seq_opt (parser)
*** 6533,6539 ****
       explicit-instantiation
       explicit-specialization
       linkage-specification
!      namespace-definition    */

  static void
  cp_parser_declaration (parser)
--- 6533,6544 ----
       explicit-instantiation
       explicit-specialization
       linkage-specification
!      namespace-definition
!
!    GNU extension:
!
!    declaration:
!       __extension__ declaration */

  static void
  cp_parser_declaration (parser)
*************** cp_parser_declaration (parser)
*** 6541,6546 ****
--- 6546,6563 ----
  {
    cp_token token1;
    cp_token token2;
+   int saved_pedantic;
+
+   /* Check for the `__extension__' keyword.  */
+   if (cp_parser_extension_opt (parser, &saved_pedantic))
+     {
+       /* Parse the qualified declaration.  */
+       cp_parser_declaration (parser);
+       /* Restore the PEDANTIC flag.  */
+       pedantic = saved_pedantic;
+
+       return;
+     }

    /* Try to figure out what kind of declaration is present.  */
    token1 = *cp_lexer_peek_token (parser->lexer);





More information about the Gcc-patches mailing list