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]

[C++ PATCH,committed] Fix typos in pt.c


Hi,

I did some work on pt.c, noticed a couple typos in the
comments and decided to run a spell check on it.  The included
patch is the result of the work.  Patch committed since it
only changes the comment.

--Kriang


2000-12-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	* pt.c: Fix typo in comment.


diff -cprN gcc-old/gcc/cp/pt.c gcc-new/gcc/cp/pt.c
*** gcc-old/gcc/cp/pt.c	Wed Nov 29 17:22:00 2000
--- gcc-new/gcc/cp/pt.c	Fri Dec  1 17:03:05 2000
*************** begin_specialization ()
*** 639,645 ****
    check_specialization_scope ();
  }
  
! /* Called at then end of processing a declaration preceeded by
     template<>.  */
  
  void 
--- 639,645 ----
    check_specialization_scope ();
  }
  
! /* Called at then end of processing a declaration preceded by
     template<>.  */
  
  void 
*************** retrieve_specialization (tmpl, args)
*** 747,753 ****
    return NULL_TREE;
  }
  
! /* Like retrieve_speciailization, but for local declarations.  */
  
  static tree
  retrieve_local_specialization (tmpl)
--- 747,753 ----
    return NULL_TREE;
  }
  
! /* Like retrieve_specialization, but for local declarations.  */
  
  static tree
  retrieve_local_specialization (tmpl)
*************** check_explicit_specialization (declarato
*** 1508,1514 ****
  		  /* If TMPL is not the most general template (for
  		     example, if TMPL is a friend template that is
  		     injected into namespace scope), then there will
! 		     be too many levels fo TARGS.  Remove some of them
  		     here.  */
  		  int i;
  		  tree new_targs;
--- 1508,1514 ----
  		  /* If TMPL is not the most general template (for
  		     example, if TMPL is a friend template that is
  		     injected into namespace scope), then there will
! 		     be too many levels of TARGS.  Remove some of them
  		     here.  */
  		  int i;
  		  tree new_targs;
*************** push_template_decl_real (decl, is_friend
*** 2416,2422 ****
         it is defined.  */
      ctx = CP_DECL_CONTEXT (decl);
    else
!     /* Otherwise, if we're currently definining some class, the DECL
         is assumed to be a member of the class.  */
      ctx = current_scope ();
  
--- 2416,2422 ----
         it is defined.  */
      ctx = CP_DECL_CONTEXT (decl);
    else
!     /* Otherwise, if we're currently defining some class, the DECL
         is assumed to be a member of the class.  */
      ctx = current_scope ();
  
*************** redeclare_class_template (type, parms)
*** 2702,2708 ****
  
  /* Attempt to convert the non-type template parameter EXPR to the
     indicated TYPE.  If the conversion is successful, return the
!    converted value.  If the conversion is unsuccesful, return
     NULL_TREE if we issued an error message, or error_mark_node if we
     did not.  We issue error messages for out-and-out bad template
     parameters, but not simply because the conversion failed, since we
--- 2702,2708 ----
  
  /* Attempt to convert the non-type template parameter EXPR to the
     indicated TYPE.  If the conversion is successful, return the
!    converted value.  If the conversion is unsuccessful, return
     NULL_TREE if we issued an error message, or error_mark_node if we
     did not.  We issue error messages for out-and-out bad template
     parameters, but not simply because the conversion failed, since we
*************** convert_template_argument (parm, arg, ar
*** 3334,3340 ****
  	   the standard.  Accepting this is not merely an
  	   extension, since deciding whether or not these
  	   conversions can occur is part of determining which
! 	   function template to call, or whether a given epxlicit
  	   argument specification is legal.  */
  	val = convert_nontype_argument (t, arg);
        else
--- 3334,3340 ----
  	   the standard.  Accepting this is not merely an
  	   extension, since deciding whether or not these
  	   conversions can occur is part of determining which
! 	   function template to call, or whether a given explicit
  	   argument specification is legal.  */
  	val = convert_nontype_argument (t, arg);
        else
*************** lookup_template_class (d1, arglist, in_d
*** 3909,3915 ****
  	      
  	      /* Note that we use DECL_CONTEXT, rather than
  		 CP_DECL_CONTEXT, so that the termination test is
! 		 always just `ctx'.  We're not interested in namepace
  		 scopes.  */
  	      for (ctx = current_class_type; 
  		   ctx; 
--- 3909,3915 ----
  	      
  	      /* Note that we use DECL_CONTEXT, rather than
  		 CP_DECL_CONTEXT, so that the termination test is
! 		 always just `ctx'.  We're not interested in namespace
  		 scopes.  */
  	      for (ctx = current_class_type; 
  		   ctx; 
*************** tinst_for_decl ()
*** 4397,4403 ****
  /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL.  ARGS is the
     vector of template arguments, as for tsubst.
  
!    Returns an appropriate tsbust'd friend declaration.  */
  
  static tree
  tsubst_friend_function (decl, args)
--- 4397,4403 ----
  /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL.  ARGS is the
     vector of template arguments, as for tsubst.
  
!    Returns an appropriate tsubst'd friend declaration.  */
  
  static tree
  tsubst_friend_function (decl, args)
*************** tsubst_friend_function (decl, args)
*** 4629,4635 ****
  /* FRIEND_TMPL is a friend TEMPLATE_DECL.  ARGS is the vector of
     template arguments, as for tsubst.
  
!    Returns an appropriate tsbust'd friend type or error_mark_node on
     failure.  */
  
  static tree
--- 4629,4635 ----
  /* FRIEND_TMPL is a friend TEMPLATE_DECL.  ARGS is the vector of
     template arguments, as for tsubst.
  
!    Returns an appropriate tsubst'd friend type or error_mark_node on
     failure.  */
  
  static tree
*************** instantiate_class_template (type)
*** 4915,4921 ****
  
  	  pbase = TREE_VEC_ELT (pbases, i);
  
! 	  /* Substitue to figure out the base class.  */
  	  base = tsubst (BINFO_TYPE (pbase), args, 
  			 /*complain=*/1, NULL_TREE);
  	  if (base == error_mark_node)
--- 4915,4921 ----
  
  	  pbase = TREE_VEC_ELT (pbases, i);
  
! 	  /* Substitute to figure out the base class.  */
  	  base = tsubst (BINFO_TYPE (pbase), args, 
  			 /*complain=*/1, NULL_TREE);
  	  if (base == error_mark_node)
*************** instantiate_class_template (type)
*** 4960,4966 ****
  
    /* Now that our base classes are set up, enter the scope of the
       class, so that name lookups into base classes, etc. will work
!      corectly.  This is precisely analagous to what we do in
       begin_class_definition when defining an ordinary non-template
       class.  */
    pushclass (type, 1);
--- 4960,4966 ----
  
    /* Now that our base classes are set up, enter the scope of the
       class, so that name lookups into base classes, etc. will work
!      correctly.  This is precisely analogous to what we do in
       begin_class_definition when defining an ordinary non-template
       class.  */
    pushclass (type, 1);
*************** instantiate_class_template (type)
*** 5134,5140 ****
    if (!PRIMARY_TEMPLATE_P (template))
      for (t = TYPE_METHODS (type); t; t = TREE_CHAIN (t))
        if (TREE_CODE (t) == FUNCTION_DECL 
! 	  /* Implicitly generated member functions will not have tmplate
  	     information; they are not instantiations, but instead are
  	     created "fresh" for each instantiation.  */
  	  && DECL_TEMPLATE_INFO (t))
--- 5134,5140 ----
    if (!PRIMARY_TEMPLATE_P (template))
      for (t = TYPE_METHODS (type); t; t = TREE_CHAIN (t))
        if (TREE_CODE (t) == FUNCTION_DECL 
! 	  /* Implicitly generated member functions will not have template
  	     information; they are not instantiations, but instead are
  	     created "fresh" for each instantiation.  */
  	  && DECL_TEMPLATE_INFO (t))
*************** tsubst_template_parms (parms, args, comp
*** 5286,5292 ****
     type T.  If T is not an aggregate or enumeration type, it is
     handled as if by tsubst.  IN_DECL is as for tsubst.  If
     ENTERING_SCOPE is non-zero, T is the context for a template which
!    we are presently tsubst'ing.  Return the subsituted value.  */
  
  static tree
  tsubst_aggr_type (t, args, complain, in_decl, entering_scope)
--- 5286,5292 ----
     type T.  If T is not an aggregate or enumeration type, it is
     handled as if by tsubst.  IN_DECL is as for tsubst.  If
     ENTERING_SCOPE is non-zero, T is the context for a template which
!    we are presently tsubst'ing.  Return the substituted value.  */
  
  static tree
  tsubst_aggr_type (t, args, complain, in_decl, entering_scope)
*************** tsubst_decl (t, args, type, in_decl)
*** 5589,5595 ****
  	         template <class T> struct S { template <class U> void f(); }
  		 template <> template <class U> void S<int>::f(U); 
  
! 	       Here, we'll be subtituting into the specialization,
  	       because that's where we can find the code we actually
  	       want to generate, but we'll have enough arguments for
  	       the most general template.	       
--- 5589,5595 ----
  	         template <class T> struct S { template <class U> void f(); }
  		 template <> template <class U> void S<int>::f(U); 
  
! 	       Here, we'll be substituting into the specialization,
  	       because that's where we can find the code we actually
  	       want to generate, but we'll have enough arguments for
  	       the most general template.	       
*************** fn_type_unification (fn, explicit_targs,
*** 7665,7671 ****
     sections are symmetric.  PARM is the type of a function parameter
     or the return type of the conversion function.  ARG is the type of
     the argument passed to the call, or the type of the value
!    intialized with the result of the conversion function.  */
  
  static void
  maybe_adjust_types_for_deduction (strict, parm, arg)
--- 7665,7671 ----
     sections are symmetric.  PARM is the type of a function parameter
     or the return type of the conversion function.  ARG is the type of
     the argument passed to the call, or the type of the value
!    initialized with the result of the conversion function.  */
  
  static void
  maybe_adjust_types_for_deduction (strict, parm, arg)
*************** maybe_adjust_types_for_deduction (strict
*** 7734,7740 ****
      *parm = TREE_TYPE (*parm);
  }
  
! /* Like type_unfication.
  
     If SUBR is 1, we're being called recursively (to unify the
     arguments of a function or method parameter of a function
--- 7734,7740 ----
      *parm = TREE_TYPE (*parm);
  }
  
! /* Like type_unification.
  
     If SUBR is 1, we're being called recursively (to unify the
     arguments of a function or method parameter of a function
*************** try_class_unification (tparms, targs, pa
*** 8144,8150 ****
  }
  
  /* Subroutine of get_template_base.  RVAL, if non-NULL, is a base we
!    have alreay discovered to be satisfactory.  ARG_BINFO is the binfo
     for the base class of ARG that we are currently examining.  */
  
  static tree
--- 8144,8150 ----
  }
  
  /* Subroutine of get_template_base.  RVAL, if non-NULL, is a base we
!    have already discovered to be satisfactory.  ARG_BINFO is the binfo
     for the base class of ARG that we are currently examining.  */
  
  static tree
*************** check_cv_quals_for_unify (strict, arg, p
*** 8291,8297 ****
  }
  
  /* Takes parameters as for type_unification.  Returns 0 if the
!    type deduction suceeds, 1 otherwise.  The parameter STRICT is a
     bitwise or of the following flags:
  
       UNIFY_ALLOW_NONE:
--- 8291,8297 ----
  }
  
  /* Takes parameters as for type_unification.  Returns 0 if the
!    type deduction succeeds, 1 otherwise.  The parameter STRICT is a
     bitwise or of the following flags:
  
       UNIFY_ALLOW_NONE:
*************** unify (tparms, targs, parm, arg, strict)
*** 8680,8686 ****
  	       Then, we should unify `int' and `U'.  */
  	    t = arg;
  	  else
! 	    /* There's no chance of unication succeeding.  */
  	    return 1;
  
  	  return unify (tparms, targs, CLASSTYPE_TI_ARGS (parm),
--- 8680,8686 ----
  	       Then, we should unify `int' and `U'.  */
  	    t = arg;
  	  else
! 	    /* There's no chance of unification succeeding.  */
  	    return 1;
  
  	  return unify (tparms, targs, CLASSTYPE_TI_ARGS (parm),
*************** get_class_bindings (tparms, parms, args)
*** 8995,9001 ****
  /* In INSTANTIATIONS is a list of <INSTANTIATION, TEMPLATE> pairs.
     Pick the most specialized template, and return the corresponding
     instantiation, or if there is no corresponding instantiation, the
!    template itself.  EXPLICIT_ARGS is any template arguments explicity
     mentioned in a template-id.  If there is no most specialized
     template, error_mark_node is returned.  If there are no templates
     at all, NULL_TREE is returned.  */
--- 8995,9001 ----
  /* In INSTANTIATIONS is a list of <INSTANTIATION, TEMPLATE> pairs.
     Pick the most specialized template, and return the corresponding
     instantiation, or if there is no corresponding instantiation, the
!    template itself.  EXPLICIT_ARGS is any template arguments explicitly
     mentioned in a template-id.  If there is no most specialized
     template, error_mark_node is returned.  If there are no templates
     at all, NULL_TREE is returned.  */
*************** do_decl_instantiation (declspecs, declar
*** 9189,9195 ****
    int extern_p = 0;
  
    if (!decl)
!     /* An error ocurred, for which grokdeclarator has already issued
         an appropriate message.  */
      return;
    else if (! DECL_LANG_SPECIFIC (decl))
--- 9189,9195 ----
    int extern_p = 0;
  
    if (!decl)
!     /* An error occurred, for which grokdeclarator has already issued
         an appropriate message.  */
      return;
    else if (! DECL_LANG_SPECIFIC (decl))
*************** do_decl_instantiation (declspecs, declar
*** 9247,9253 ****
  	 We check DECL_INTERFACE_KNOWN so as not to complain when the first
  	 instantiation was `extern' and the second is not, and EXTERN_P for
  	 the opposite case.  If -frepo, chances are we already got marked
! 	 as an explicit instantion because of the repo file.  */
        if (DECL_INTERFACE_KNOWN (result) && !extern_p && !flag_use_repository)
  	cp_pedwarn ("duplicate explicit instantiation of `%#D'", result);
  
--- 9247,9253 ----
  	 We check DECL_INTERFACE_KNOWN so as not to complain when the first
  	 instantiation was `extern' and the second is not, and EXTERN_P for
  	 the opposite case.  If -frepo, chances are we already got marked
! 	 as an explicit instantiation because of the repo file.  */
        if (DECL_INTERFACE_KNOWN (result) && !extern_p && !flag_use_repository)
  	cp_pedwarn ("duplicate explicit instantiation of `%#D'", result);
  
*************** do_type_instantiation (t, storage, compl
*** 9427,9433 ****
  
         Of course, we can't instantiate member template classes, since
         we don't have any arguments for them.  Note that the standard
!        is unclear on whether the instatiation of the members are
         *explicit* instantiations or not.  We choose to be generous,
         and not set DECL_EXPLICIT_INSTANTIATION.  Therefore, we allow
         the explicit instantiation of a class where some of the members
--- 9427,9433 ----
  
         Of course, we can't instantiate member template classes, since
         we don't have any arguments for them.  Note that the standard
!        is unclear on whether the instantiation of the members are
         *explicit* instantiations or not.  We choose to be generous,
         and not set DECL_EXPLICIT_INSTANTIATION.  Therefore, we allow
         the explicit instantiation of a class where some of the members
*************** instantiate_decl (d, defer_ok)
*** 9587,9593 ****
  
    if (DECL_TEMPLATE_INSTANTIATED (d))
      /* D has already been instantiated.  It might seem reasonable to
!        check whether or not D is an explict instantiation, and, if so,
         stop here.  But when an explicit instantiation is deferred
         until the end of the compilation, DECL_EXPLICIT_INSTANTIATION
         is set, even though we still need to do the instantiation.  */
--- 9587,9593 ----
  
    if (DECL_TEMPLATE_INSTANTIATED (d))
      /* D has already been instantiated.  It might seem reasonable to
!        check whether or not D is an explicit instantiation, and, if so,
         stop here.  But when an explicit instantiation is deferred
         until the end of the compilation, DECL_EXPLICIT_INSTANTIATION
         is set, even though we still need to do the instantiation.  */
*************** instantiate_decl (d, defer_ok)
*** 9632,9638 ****
  	      S<int>::f<U> say, is not an instantiation of S<T>::f<U>,
  	      so far as the language is concerned, but that's still
  	      where we get the pattern for the instantiation from.  On
! 	      ther hand, if the definition comes outside the class, say:
  
  		template <class T> struct S { 
  		  template <class U> friend void f();
--- 9632,9638 ----
  	      S<int>::f<U> say, is not an instantiation of S<T>::f<U>,
  	      so far as the language is concerned, but that's still
  	      where we get the pattern for the instantiation from.  On
! 	      other hand, if the definition comes outside the class, say:
  
  		template <class T> struct S { 
  		  template <class U> friend void f();
*************** get_mostly_instantiated_function_type (d
*** 10041,10047 ****
        tree partial_args;
  
        /* Replace the innermost level of the TARGS with NULL_TREEs to
! 	 let tsubst know not to subsitute for those parameters.  */
        partial_args = make_tree_vec (TREE_VEC_LENGTH (targs));
        for (i = 1; i < TMPL_ARGS_DEPTH (targs); ++i)
  	SET_TMPL_ARGS_LEVEL (partial_args, i,
--- 10041,10047 ----
        tree partial_args;
  
        /* Replace the innermost level of the TARGS with NULL_TREEs to
! 	 let tsubst know not to substitute for those parameters.  */
        partial_args = make_tree_vec (TREE_VEC_LENGTH (targs));
        for (i = 1; i < TMPL_ARGS_DEPTH (targs); ++i)
  	SET_TMPL_ARGS_LEVEL (partial_args, i,
*************** set_mangled_name_for_template_decl (decl
*** 10167,10173 ****
  }
  
  /* Return truthvalue if we're processing a template different from
!    the last one involved in diagnotics.  */
  int
  problematic_instantiation_changed ()
  {
--- 10167,10173 ----
  }
  
  /* Return truthvalue if we're processing a template different from
!    the last one involved in diagnostics.  */
  int
  problematic_instantiation_changed ()
  {


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