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]

[PATCH] -funsigned-bitfields breaks parsing


This patch repairs a problem causing the following test to fail when -funsigned-bitfields is specified on the command line:

	gcc -funsigned-bitfields -pedantic-errors -ansi -c g++.old-deja/g++.bugs/900401_01.C

When unsigned bitfields was specified, the basic type of a variable was defaulted to unsigned, rather than passing through if it was an aggregate.

ChangeLog:

Wed 02 Jun 1999 09:21:10 Eric Raskin (ehr@listworks.com)

	* cp/decl.c: Don't default to unsigned if -funsigned-bitfield and
	not a basic type.

--- /lw/downloads/egcs-19990524-orig/gcc/cp/decl.c	Thu May 20 14:10:51 1999
+++ /lw/downloads/egcs-19990524/gcc/cp/decl.c	Wed Jun  2 09:14:57 1999
@@ -9912,6 +9912,15 @@ grokdeclarator (declarator, declspecs, d
 	      || ! (typedef_decl != NULL_TREE
 		    && C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl)))
 	  && TREE_CODE (type) != ENUMERAL_TYPE
+  /* the type must be a basic type, even if it was defaulted to int */
+	  && TREE_CODE (type) != ARRAY_TYPE
+	  && TREE_CODE (type) != RECORD_TYPE
+	  && TREE_CODE (type) != UNION_TYPE
+	  && TREE_CODE (type) != QUAL_UNION_TYPE
+	  && TREE_CODE (type) != SET_TYPE
+	  && TREE_CODE (type) != REFERENCE_TYPE
+	  && TREE_CODE (type) != OFFSET_TYPE
+	  && TREE_CODE (type) != POINTER_TYPE
 	  && RIDBIT_NOTSETP (RID_SIGNED, specbits)))
     {
       if (longlong)

	
------------------------------------------------------------------------
Eric H. Raskin                            Voice:  914-769-7100 x321
President, CSC Division                   Fax:    914-769-8070
The Listworks Corp.                       E-Mail: ehr@listworks.com
1 Campus Drive
Pleasantville, NY 10570


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