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] Obvious code omission in diagnostic


Hi

The following patch fixes one obvious bug.  An argument is missing from
error() function call, causing segfault on some platform (this was 
reported at http://gcc.gnu.org/ml/gcc-bugs/2002-12/msg00844.html).  
I will commit it to 3.2 and 3.3 branch later together with a bunch of
my approved patch.

--Kriang


2002-12-02  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	* parse.y (bad_parm): Add missing argument to error function call.


diff -cpr gcc-32-save/gcc/cp/parse.y gcc-32-new/gcc/cp/parse.y
*** gcc-32-save/gcc/cp/parse.y	Sat Oct 26 00:46:00 2002
--- gcc-32-new/gcc/cp/parse.y	Tue Dec 17 23:00:58 2002
*************** bad_parm:
*** 3823,3829 ****
  		    {
  		      if (TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TYPE_PARM
  			  || TREE_CODE (TREE_OPERAND ($$, 0)) == BOUND_TEMPLATE_TEMPLATE_PARM)
! 			error ("`%E' is not a type, use `typename %E' to make it one", $$);
  		      else
  			error ("no type `%D' in `%T'", TREE_OPERAND ($$, 1), TREE_OPERAND ($$, 0));
  		    }
--- 3823,3829 ----
  		    {
  		      if (TREE_CODE (TREE_OPERAND ($$, 0)) == TEMPLATE_TYPE_PARM
  			  || TREE_CODE (TREE_OPERAND ($$, 0)) == BOUND_TEMPLATE_TEMPLATE_PARM)
! 			error ("`%E' is not a type, use `typename %E' to make it one", $$, $$);
  		      else
  			error ("no type `%D' in `%T'", TREE_OPERAND ($$, 1), TREE_OPERAND ($$, 0));
  		    }


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