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]

patch: c++ fix for grokparms


On function calls taking opaque types, the C++ front end was modifying
the type in such a way that we loose the original typedef information.
This was because we take the TYPE_MAIN_VARIANT of the type.

This patch fixes the problem and has been irc-pre-approved by Jason.

Tested on x86.

Committed to mainline and e500 branch.

2003-08-06  Aldy Hernandez  <aldyh@redhat.com>

	* cp/decl.c (grokparms): Use cp_build_qualified_type instead
	TYPE_MAIN_VARIANT.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1110
diff -c -p -r1.1110 decl.c
*** cp/decl.c	5 Aug 2003 14:11:48 -0000	1.1110
--- cp/decl.c	6 Aug 2003 17:24:14 -0000
*************** grokparms (tree first_parm)
*** 11970,11976 ****
  	{
  	  /* Top-level qualifiers on the parameters are
  	     ignored for function types.  */
! 	  type = TYPE_MAIN_VARIANT (type);
  	  if (TREE_CODE (type) == METHOD_TYPE)
  	    {
  	      error ("parameter `%D' invalidly declared method type", decl);
--- 11970,11976 ----
  	{
  	  /* Top-level qualifiers on the parameters are
  	     ignored for function types.  */
! 	  type = cp_build_qualified_type (type, 0);
  	  if (TREE_CODE (type) == METHOD_TYPE)
  	    {
  	      error ("parameter `%D' invalidly declared method type", decl);


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