gxxint.texi: Remove obsolete documentation of overloading code.
authorJason Merrill <jason@yorick.cygnus.com>
Mon, 17 Aug 1998 17:13:42 +0000 (17:13 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 17 Aug 1998 17:13:42 +0000 (13:13 -0400)
* gxxint.texi: Remove obsolete documentation of overloading code.
* decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
* tree.c (lvalue_type): Fix for arrays.
* typeck.c (build_unary_op): Use lvalue_type.
* call.c (add_function_candidate): Likewise.
* cvt.c (convert_to_reference): Likewise.
* decl2.c (lang_decode_option): Ignore -traditional.

From-SVN: r21795

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/gxxint.texi
gcc/cp/tree.c
gcc/cp/typeck.c

index 1379f0741c21added6aad49af693fc0a8a079bb7..58ee77c90423201ff9075149804dac8f4e26ddf3 100644 (file)
@@ -1,5 +1,16 @@
 1998-08-17  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * gxxint.texi: Remove obsolete documentation of overloading code.
+
+       * decl.c (finish_enum): Also set TYPE_SIZE_UNIT.
+
+       * tree.c (lvalue_type): Fix for arrays.
+       * typeck.c (build_unary_op): Use lvalue_type.
+       * call.c (add_function_candidate): Likewise.
+       * cvt.c (convert_to_reference): Likewise.
+
+       * decl2.c (lang_decode_option): Ignore -traditional.
+
        * init.c (build_offset_ref): Don't mess with error_mark_node.
        * lex.c (do_scoped_id): Use cp_error.
 
index e65898eaf7d9e23bf03c2d7dbf1e6a2d15ee1271..5234a4b1762fba1a80c0abed93245ab32debcceb 100644 (file)
@@ -1144,15 +1144,9 @@ add_function_candidate (candidates, fn, arglist, flags)
   for (i = 0; i < len; ++i)
     {
       tree arg = TREE_VALUE (argnode);
-      tree argtype = TREE_TYPE (arg);
+      tree argtype = lvalue_type (arg);
       tree t;
 
-      /* An overloaded function does not have an argument type */
-      if (TREE_CODE (arg) == OVERLOAD)
-       argtype = unknown_type_node;
-      argtype = cp_build_type_variant
-       (argtype, TREE_READONLY (arg), TREE_THIS_VOLATILE (arg));
-
       if (parmnode == void_list_node)
        break;
       else if (parmnode)
index 1078488c2938cad3ce74d4ef3076603a47f662f3..1c6447a61b78eb0b43f3816179d8236331d9503f 100644 (file)
@@ -448,13 +448,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
       if (flags & LOOKUP_COMPLAIN)
        {
          tree ttl = TREE_TYPE (reftype);
-         tree ttr;
-         
-         {
-           int r = TREE_READONLY (expr);
-           int v = TREE_THIS_VOLATILE (expr);
-           ttr = cp_build_type_variant (TREE_TYPE (expr), r, v);
-         }
+         tree ttr = lvalue_type (expr);
 
          if (! real_lvalue_p (expr) && ! TYPE_READONLY (ttl))
            {
index ccaf75732d3bd63009bf37f2ff39c4425da4f20f..932fb694ad975c77697122e64f44fb410fcd8acd 100644 (file)
@@ -11891,6 +11891,7 @@ finish_enum (enumtype, values)
        TYPE_MIN_VALUE (tem) = TYPE_MIN_VALUE (enumtype);
        TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
        TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
+       TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
        TYPE_MODE (tem) = TYPE_MODE (enumtype);
        TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
        TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
index 4ffba6fabc05eca225bd1f3040cbade95813d552..6ac0beeb1844b2c46f33ecd0356c35484ad9b84c 100644 (file)
@@ -541,8 +541,7 @@ lang_decode_option (argc, argv)
 #endif /* ! USE_CPPLIB */
 
   if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
-    flag_writable_strings = 1,
-    flag_this_is_variable = 1, flag_new_for_scope = 0;
+    /* ignore */;
   /* The +e options are for cfront compatibility.  They come in as
      `-+eN', to kludge around gcc.c's argument handling.  */
   else if (p[0] == '-' && p[1] == '+' && p[2] == 'e')
index 7cb57f2665cfd7f0e6d8f0bb8a3bb0b6299f4e5d..c8f312ebfca25608723a01ee3dbc51d4db751081 100644 (file)
@@ -167,77 +167,6 @@ class foo @{ public: int b; int a; foo (); @};
 Thus, @samp{b} will be initialized with 2 first, then @samp{a} will be
 initialized with 1, regardless of how they're listed in the mem-initializer.
 
-@item Argument Matching
-
-In early 1993, the argument matching scheme in @sc{gnu} C++ changed
-significantly.  The original code was completely replaced with a new
-method that will, hopefully, be easier to understand and make fixing
-specific cases much easier.
-
-The @samp{-fansi-overloading} option is used to enable the new code; at
-some point in the future, it will become the default behavior of the
-compiler.
-
-The file @file{cp-call.c} contains all of the new work, in the functions
-@code{rank_for_overload}, @code{compute_harshness},
-@code{compute_conversion_costs}, and @code{ideal_candidate}.
-
-Instead of using obscure numerical values, the quality of an argument
-match is now represented by clear, individual codes.  The new data
-structure @code{struct harshness} (it used to be an @code{unsigned}
-number) contains:
-
-@enumerate a
-@item the @samp{code} field, to signify what was involved in matching two
-arguments;
-@item the @samp{distance} field, used in situations where inheritance
-decides which function should be called (one is ``closer'' than
-another);
-@item and the @samp{int_penalty} field, used by some codes as a tie-breaker.
-@end enumerate
-
-The @samp{code} field is a number with a given bit set for each type of
-code, OR'd together.  The new codes are:
-
-@itemize @bullet
-@item @code{EVIL_CODE}
-The argument was not a permissible match.
-
-@item @code{CONST_CODE}
-Currently, this is only used by @code{compute_conversion_costs}, to
-distinguish when a non-@code{const} member function is called from a
-@code{const} member function.
-
-@item @code{ELLIPSIS_CODE}
-A match against an ellipsis @samp{...} is considered worse than all others.
-
-@item @code{USER_CODE}
-Used for a match involving a user-defined conversion.
-
-@item @code{STD_CODE}
-A match involving a standard conversion.
-
-@item @code{PROMO_CODE}
-A match involving an integral promotion.  For these, the
-@code{int_penalty} field is used to handle the ARM's rule (XXX cite)
-that a smaller @code{unsigned} type should promote to a @code{int}, not
-to an @code{unsigned int}.
-
-@item @code{QUAL_CODE}
-Used to mark use of qualifiers like @code{const} and @code{volatile}.
-
-@item @code{TRIVIAL_CODE}
-Used for trivial conversions.  The @samp{int_penalty} field is used by
-@code{convert_harshness} to communicate further penalty information back
-to @code{build_overload_call_real} when deciding which function should
-be call.
-@end itemize
-
-The functions @code{convert_to_aggr} and @code{build_method_call} use
-@code{compute_conversion_costs} to rate each argument's suitability for
-a given candidate function (that's how we get the list of candidates for
-@code{ideal_candidate}).
-
 @item The Explicit Keyword
 
 The use of @code{explicit} on a constructor is used by @code{grokdeclarator}
index 8b782bbb85c3a5861e5ca09e2daefeec94b59e34..685810ae5045eb0b7ab057b6d805ec8fceb7c7e9 100644 (file)
@@ -2368,8 +2368,10 @@ lvalue_type (arg)
   tree type = TREE_TYPE (arg);
   if (TREE_CODE (arg) == OVERLOAD)
     type = unknown_type_node;
-  return cp_build_type_variant
-    (type, TREE_READONLY (arg), TREE_THIS_VOLATILE (arg));
+  if (TREE_CODE (type) != ARRAY_TYPE)
+    type = cp_build_type_variant
+      (type, TREE_READONLY (arg), TREE_THIS_VOLATILE (arg));
+  return type;
 }
 
 /* The type of ARG for printing error messages; denote lvalues with
index 008a3157a522b323938c0084f5cd695fc03fe053..1fa589c54b037e8867a6a21904f8cca94836ea0c 100644 (file)
@@ -4506,12 +4506,12 @@ build_unary_op (code, xarg, noconvert)
       /* Note that this operation never does default_conversion
         regardless of NOCONVERT.  */
 
-      argtype = TREE_TYPE (arg);
+      argtype = lvalue_type (arg);
       if (TREE_CODE (argtype) == REFERENCE_TYPE)
        {
          arg = build1
            (CONVERT_EXPR,
-            build_pointer_type (TREE_TYPE (TREE_TYPE (arg))), arg);
+            build_pointer_type (TREE_TYPE (argtype)), arg);
          TREE_CONSTANT (arg) = TREE_CONSTANT (TREE_OPERAND (arg, 0));
          return arg;
        }
@@ -4639,18 +4639,6 @@ build_unary_op (code, xarg, noconvert)
               && !lvalue_or_else (arg, "unary `&'"))
        return error_mark_node;
 
-      /* Ordinary case; arg is a COMPONENT_REF or a decl.  */
-      /* If the lvalue is const or volatile,
-        merge that into the type that the address will point to.  */
-      if (TREE_CODE_CLASS (TREE_CODE (arg)) == 'd'
-         || TREE_CODE_CLASS (TREE_CODE (arg)) == 'r')
-       {
-         if (TREE_READONLY (arg) || TREE_THIS_VOLATILE (arg))
-           argtype = cp_build_type_variant (argtype,
-                                           TREE_READONLY (arg),
-                                           TREE_THIS_VOLATILE (arg));
-       }
-
       argtype = build_pointer_type (argtype);
 
       if (mark_addressable (arg) == 0)