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]
Other format: [Raw text]

C++ PATCH to cp_parser_primary_expression


This patch fixes a 3.4 regression whereby we were failing to dereference a
qualified-id which names a reference static data member, resulting in type
comparison problems.

Fixes g++.dg/conversion/cond4.C.  Tested i686-pc-linux-gnu, applied to
trunk.

2003-05-15  Jason Merrill  <jason@redhat.com>

	* parser.c (cp_parser_primary_expression): Convert a static data
	member from reference.

*** parser.c.~1~	2003-05-15 16:44:09.000000000 -0400
--- parser.c	2003-05-15 17:45:35.000000000 -0400
*************** cp_parser_primary_expression (cp_parser 
*** 2800,2805 ****
--- 2800,2807 ----
  			(decl, parser->scope, current_class_type));
  		if (TREE_CODE (decl) == FIELD_DECL || BASELINK_P (decl))
  		  *qualifying_class = parser->scope;
+ 		else if (!processing_template_decl)
+ 		  decl = convert_from_reference (decl);
  	      }
  	    else
  	      /* Transform references to non-static data members into

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