+Thu Aug 14 10:05:13 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * rtti.c (permanent_obstack): Fix decl to not be a pointer.
+
+ * cp-tree.h (report_type_mismatch): Add prototype.
+ * call.c (build_overload_call_real): Remove erroneous fourth
+ argument to report_type_mismatch.
+ (build_user_type_conversion_1): Remove erroneous second arg to
+ tourney.
+ (build_new_function_call): Likewise.
+ (build_object_call): Likewise.
+ (build_new_op): Likewise.
+ (build_new_method_call): Likewise.
+
+Wed Aug 13 19:19:25 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * error.c (dump_decl): Don't bother processing a function with no
+ DECL_LANG_SPECIFIC.
+
+ * method.c (emit_thunk): Call init_function_start in the macro case.
+
+Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
+
+ * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not
+ defined and used to set flag_vtable_thunks.
+
+Tue Aug 12 20:13:57 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * parse.y: Don't clear the inlines from their obstack until they've
+ all been processed.
+
+ * decl.c (duplicate_decls): Don't complain about exception
+ specification mismatch if flag_exceptions is off.
+
+Mon Aug 11 15:01:56 1997 Marc Lehmann <pcg@goof.com>
+
+ * Make-lang.in (c++.distclean): Remove g++.c on make distclean.
+
+Sun Aug 10 12:06:09 1997 Paul Eggert <eggert@twinsun.com>
+
+ * cp-tree.h: Replace STDIO_PROTO with PROTO in include files.
+ * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c:
+ Include <stdio.h> before include files that formerly used STDIO_PROTO.
+
+ * decl.c, g++spec.c, lex.c, method.c, repo.c:
+ Include "config.h" first, as per autoconf manual.
+
+Fri Aug 8 11:47:48 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl.c (duplicate_decls): Tweak wording.
+ * lex.c (do_pending_defargs): Don't die if we see a default arg
+ that isn't a DEFAULT_ARG.
+ * error.c (dump_expr): Handle DEFAULT_ARG.
+
+ * decl2.c (lang_decode_option): Handle -fhandle-exceptions.
+ * lang-options.h: Add -fhandle-exceptions.
+
+ * class.c (build_vtable): vtables are artificial.
+ (prepare_fresh_vtable): Likewise.
+
+Wed Aug 6 11:02:36 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * cvt.c (ocp_convert): After converting to the target type, set
+ LOOKUP_NO_CONVERSION.
+
+ * call.c (joust): Warn about potentially confusing promotion rules
+ with -Wsign-promo.
+ * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo.
+
+Tue Aug 5 15:15:07 1997 Michael Meissner <meissner@cygnus.com>
+
+ * exception.cc: Declare __terminate_func with noreturn attribute.
+
Fri Aug 1 03:18:15 1997 Jason Merrill <jason@yorick.cygnus.com>
* parse.y: Break out eat_saved_input, handle errors.
+ (function_try_block): Use compstmt instead of compstmt_or_error.
Thu Jul 31 17:14:04 1997 Jason Merrill <jason@yorick.cygnus.com>
function is not changed.
* call.c (build_over_call): Move setting of conv into the loop.
+ Note: this change, along with the related changes of the 18th thru
+ the 20th of April, fix an infinite loop problem in conversions.
Sun Apr 20 16:24:29 1997 Jason Merrill <jason@yorick.cygnus.com>
c++.distclean:
-rm -f cp/config.status cp/Makefile
-rm -f cp/parse.output
+ -rm -f g++.c
c++.extraclean:
c++.maintainer-clean:
-rm -f cp/parse.c cp/parse.h
return NULL_TREE;
if (flags & LOOKUP_COMPLAIN)
- report_type_mismatch (cp, parms, "function",
- decl_as_string (cp->function, 1));
+ report_type_mismatch (cp, parms, "function");
return error_mark_node;
}
}
candidates = splice_viable (candidates);
- cand = tourney (candidates, totype);
+ cand = tourney (candidates);
if (cand == 0)
{
return error_mark_node;
}
candidates = splice_viable (candidates);
- cand = tourney (candidates, NULL_TREE);
+ cand = tourney (candidates);
if (cand == 0)
{
}
candidates = splice_viable (candidates);
- cand = tourney (candidates, NULL_TREE);
+ cand = tourney (candidates);
if (cand == 0)
{
return error_mark_node;
}
candidates = splice_viable (candidates);
- cand = tourney (candidates, NULL_TREE);
+ cand = tourney (candidates);
if (cand == 0)
{
return error_mark_node;
}
candidates = splice_viable (candidates);
- cand = tourney (candidates, NULL_TREE);
+ cand = tourney (candidates);
if (cand == 0)
{
for (i = 0; i < len; ++i)
{
- int comp = compare_ics (TREE_VEC_ELT (cand1->convs, i+off1),
- TREE_VEC_ELT (cand2->convs, i+off2));
+ tree t1 = TREE_VEC_ELT (cand1->convs, i+off1);
+ tree t2 = TREE_VEC_ELT (cand2->convs, i+off2);
+ int comp = compare_ics (t1, t2);
if (comp != 0)
{
+ if (warn_sign_promo
+ && ICS_RANK (t1) + ICS_RANK (t2) == STD_RANK + PROMO_RANK
+ && TREE_CODE (t1) == STD_CONV
+ && TREE_CODE (t2) == STD_CONV
+ && TREE_CODE (TREE_TYPE (t1)) == INTEGER_TYPE
+ && TREE_CODE (TREE_TYPE (t2)) == INTEGER_TYPE
+ && (TYPE_PRECISION (TREE_TYPE (t1))
+ == TYPE_PRECISION (TREE_TYPE (t2)))
+ && (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (t1, 0)))
+ || (TREE_CODE (TREE_TYPE (TREE_OPERAND (t1, 0)))
+ == ENUMERAL_TYPE)))
+ {
+ tree type = TREE_TYPE (TREE_OPERAND (t1, 0));
+ tree type1, type2;
+ if (comp > 0)
+ type1 = TREE_TYPE (t1), type2 = TREE_TYPE (t2);
+ else
+ type1 = TREE_TYPE (t2), type2 = TREE_TYPE (t1);
+
+ cp_warning ("`%T' promotes to `%T', not `%T'",
+ type, type1, type2);
+ cp_warning (" in call to `%D'", DECL_NAME (cand1->fn));
+ }
+
if (winner && comp != winner)
{
winner = 0;
TYPE_BINFO_VTABLE (type) = decl;
TYPE_BINFO_VIRTUALS (type) = virtuals;
+ DECL_ARTIFICIAL (decl) = 1;
TREE_STATIC (decl) = 1;
#ifndef WRITABLE_VTABLES
/* Make them READONLY by default. (mrs) */
/* Remember which class this vtable is really for. */
DECL_CONTEXT (new_decl) = for_type;
+ DECL_ARTIFICIAL (new_decl) = 1;
TREE_STATIC (new_decl) = 1;
BINFO_VTABLE (binfo) = pushdecl_top_level (new_decl);
DECL_VIRTUAL_P (new_decl) = 1;
extern int warn_ecpp;
+/* Nonzero means warn where overload resolution chooses a promotion from
+ unsigned to signed over a conversion to an unsigned of the same size. */
+
+extern int warn_sign_promo;
+
/* Non-zero means warn when a function is declared extern and later inline. */
extern int warn_extern_inline;
extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree));
/* Read the rest of the current #-directive line. */
-extern char *get_directive_line STDIO_PROTO((FILE *));
+extern char *get_directive_line PROTO((FILE *));
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
/* in method.c */
extern void init_method PROTO((void));
extern void do_inline_function_hair PROTO((tree, tree));
-/* skip report_type_mismatch */
+extern void report_type_mismatch PROTO((struct candidate *, tree, char *));
extern char *build_overload_name PROTO((tree, int, int));
extern tree build_static_name PROTO((tree, tree));
extern tree build_decl_overload PROTO((tree, tree, int));
but what kind of conversions it does will depend on the language. */
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "flags.h"
#include "cp-tree.h"
if ((flags & LOOKUP_ONLYCONVERTING)
&& ! (IS_AGGR_TYPE (dtype) && DERIVED_FROM_P (type, dtype)))
- ctor = build_user_type_conversion (type, ctor, flags);
+ {
+ ctor = build_user_type_conversion (type, ctor, flags);
+ flags |= LOOKUP_NO_CONVERSION;
+ }
if (ctor)
ctor = build_method_call (NULL_TREE, ctor_identifier,
build_tree_list (NULL_TREE, ctor),
/* ??? not all decl nodes are given the most useful possible
line numbers. For example, the CONST_DECLs for enum values. */
-#include <stdio.h>
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "rtl.h"
#include "flags.h"
{
cp_error ("default argument given for parameter %d of `%#D'",
i, newdecl);
- cp_error_at ("conflicts with previous specification in `%#D'",
+ cp_error_at ("after previous specification in `%#D'",
olddecl);
}
}
TYPE_RAISES_EXCEPTIONS (oldtype));
if ((pedantic || ! DECL_IN_SYSTEM_HEADER (olddecl))
+ && flag_exceptions
&& ! compexcepttypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl)))
{
cp_pedwarn ("declaration of `%D' throws different exceptions",
/* True if we want to implement vtables using "thunks".
The default is off. */
-#if defined(NEW_OVER) && defined (__i386__)
-int flag_vtable_thunks = 1;
-#else
-int flag_vtable_thunks;
+#ifndef DEFAULT_VTABLE_THUNKS
+#define DEFAULT_VTABLE_THUNKS 0
#endif
+int flag_vtable_thunks = DEFAULT_VTABLE_THUNKS;
/* True if we want to deal with repository information. */
/* Nonzero means warn about violation of some Effective C++ style rules. */
-int warn_ecpp = 0;
+int warn_ecpp;
+
+/* Nonzero means warn where overload resolution chooses a promotion from
+ unsigned to signed over a conversion to an unsigned of the same size. */
+
+int warn_sign_promo;
/* Nonzero means `$' can be in an identifier.
See cccp.c for reasons why this breaks some obscure ANSI C programs. */
{"all-virtual", &flag_all_virtual, 1},
{"memoize-lookups", &flag_memoize_lookups, 1},
{"elide-constructors", &flag_elide_constructors, 1},
+ {"handle-exceptions", &flag_exceptions, 1},
{"handle-signatures", &flag_handle_signatures, 1},
{"default-inline", &flag_default_inline, 1},
{"dollars-in-identifiers", &dollars_in_ident, 1},
p += 2;
/* Try special -f options. */
+ if (!strcmp (p, "handle-exceptions")
+ || !strcmp (p, "no-handle-exceptions"))
+ warning ("-fhandle-exceptions has been renamed to -fexceptions (and is now on by default)");
+
if (!strcmp (p, "save-memoized"))
{
flag_memoize_lookups = 1;
flag_save_memoized_contexts = 1;
found = 1;
}
- if (!strcmp (p, "no-save-memoized"))
+ else if (!strcmp (p, "no-save-memoized"))
{
flag_memoize_lookups = 0;
flag_save_memoized_contexts = 0;
warn_pmf2ptr = setting;
else if (!strcmp (p, "effc++"))
warn_ecpp = setting;
+ else if (!strcmp (p, "sign-promo"))
+ warn_sign_promo = setting;
else if (!strcmp (p, "comment"))
; /* cpp handles this one. */
else if (!strcmp (p, "comments"))
warn_uninitialized = (setting ? 2 : 0);
warn_template_debugging = setting;
warn_reorder = setting;
+ warn_sign_promo = setting;
}
else if (!strcmp (p, "overloaded-virtual"))
Boston, MA 02111-1307, USA. */
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "cp-tree.h"
#include "obstack.h"
case FUNCTION_DECL:
if (GLOBAL_IORD_P (DECL_ASSEMBLER_NAME (t)))
dump_global_iord (DECL_ASSEMBLER_NAME (t));
+ else if (! DECL_LANG_SPECIFIC (t))
+ OB_PUTS ("{internal}");
else
dump_function_decl (t, v);
break;
OB_PUTC (')');
break;
+ case DEFAULT_ARG:
+ OB_PUTS ("{unparsed}");
+ break;
+
case TREE_LIST:
if (TREE_VALUE (t) && TREE_CODE (TREE_VALUE (t)) == FUNCTION_DECL)
{
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "rtl.h"
#include "cp-tree.h"
static tree BuiltinReturnAddress;
-#include <stdio.h>
-
static void
easy_expand_asm (str)
char *str;
/* Define terminate, unexpected, set_terminate, set_unexpected as
well as the default terminate func and default unexpected func. */
-extern terminate_handler __terminate_func;
+extern terminate_handler __terminate_func __attribute__((__noreturn__));
void
terminate ()
#include "config.h"
+#include <stdio.h>
#include "rtl.h"
#include "tree.h"
#include "flags.h"
Boston, MA 02111-1307, USA. */
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "rtl.h"
#include "cp-tree.h"
+#include "config.h"
+
#include <sys/types.h>
#include <stdio.h>
-#include "config.h"
#include "gansidecl.h"
/* This bit is set if we saw a `-xfoo' language specification. */
/* High-level class interface. */
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "rtl.h"
#include "cp-tree.h"
"-fno-for-scope",
"-fgnu-keywords",
"-fno-gnu-keywords",
+ "-fhandle-exceptions",
+ "-fno-handle-exceptions",
"-fhandle-signatures",
"-fno-handle-signatures",
"-fhuge-objects",
"-Wno-pmf-conversions",
"-Weffc++",
"-Wno-effc++",
+ "-Wsign-promo",
+ "-Wno-sign-promo",
/* Cause the `yydebug' variable to be defined. */
#define YYDEBUG 1
+#include "config.h"
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <setjmp.h>
-#include "config.h"
#include "input.h"
#include "tree.h"
#include "lex.h"
defarg_parm = TREE_CHAIN (defarg_parm);
for (; defarg_parm; defarg_parm = TREE_CHAIN (defarg_parm))
- if (TREE_PURPOSE (defarg_parm))
+ if (TREE_PURPOSE (defarg_parm)
+ && TREE_CODE (TREE_PURPOSE (defarg_parm)) == DEFAULT_ARG)
{
- my_friendly_assert (TREE_CODE (TREE_PURPOSE (defarg_parm))
- == DEFAULT_ARG, 2349);
feed_defarg (defarg_fn, defarg_parm);
/* Return to the parser, which will process this defarg
#endif
/* Handle method declarations. */
-#include <stdio.h>
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "cp-tree.h"
#include "class.h"
DECL_RESULT (thunk_fndecl)
= build_decl (RESULT_DECL, 0, integer_type_node);
fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
+ init_function_start (thunk_fndecl, input_filename, lineno);
assemble_start_function (thunk_fndecl, fnname);
ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
assemble_end_function (thunk_fndecl, fnname);
{
$$.t = $<ttype>6;
$$.new_type_flag = 1;
- if (current_scope () == current_function_decl)
+ if (current_class_type == NULL_TREE)
clear_inline_text_obstack ();
}
| class_head %prec EMPTY
store_parm_decls ();
expand_start_early_try_stmts ();
}
- ctor_initializer_opt compstmt_or_error
+ ctor_initializer_opt compstmt
{ expand_start_all_catch (); }
handler_seq
{
The results of the automatic process should be easily reproducible with
explicit code. */
-#include <stdio.h>
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "cp-tree.h"
#include "input.h"
#include "config.h"
+#include <stdio.h>
#include "tree.h"
#include "cp-tree.h"
#include "flags.h"
extern tree define_function ();
extern tree build_t_desc_overload ();
-extern struct obstack *permanent_obstack;
+extern struct obstack permanent_obstack;
tree type_info_type_node;
tree tinfo_fn_id;