aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-08-17 17:13:42 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-08-17 13:13:42 -0400
commit8cd4c1752846cea2517c93a71c33bcc8e25a063c (patch)
treef93bdf9315c8122980ce7c7ba46bf398ebde9158 /gcc
parent2e245dac404f9921584d2baf3b9b98a3b88eacce (diff)
downloadgcc-8cd4c1752846cea2517c93a71c33bcc8e25a063c.zip
gcc-8cd4c1752846cea2517c93a71c33bcc8e25a063c.tar.gz
gcc-8cd4c1752846cea2517c93a71c33bcc8e25a063c.tar.bz2
gxxint.texi: Remove obsolete documentation of overloading code.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/call.c8
-rw-r--r--gcc/cp/cvt.c8
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/cp/gxxint.texi71
-rw-r--r--gcc/cp/tree.c6
-rw-r--r--gcc/cp/typeck.c16
8 files changed, 21 insertions, 103 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1379f07..58ee77c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e65898e..5234a4b 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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)
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 1078488..1c6447a 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -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))
{
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index ccaf757..932fb69 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 4ffba6f..6ac0bee 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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')
diff --git a/gcc/cp/gxxint.texi b/gcc/cp/gxxint.texi
index 7cb57f2..c8f312e 100644
--- a/gcc/cp/gxxint.texi
+++ b/gcc/cp/gxxint.texi
@@ -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}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8b782bb..685810a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 008a315..1fa589c 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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)