Commit d363e7bf by Andreas Jaeger

decl.c (cp_missing_noreturn_ok_p): New.

	* decl.c (cp_missing_noreturn_ok_p): New.
	(init_decl_processing): Set lang_missing_noreturn_ok_p.

From-SVN: r38613
parent 21c7361e
2001-01-02 Andreas Jaeger <aj@suse.de>
* decl.c (cp_missing_noreturn_ok_p): New.
(init_decl_processing): Set lang_missing_noreturn_ok_p.
2000-12-29 Jakub Jelinek <jakub@redhat.com> 2000-12-29 Jakub Jelinek <jakub@redhat.com>
* decl.c (init_decl_processing): Fix sign of wchar_type_node. * decl.c (init_decl_processing): Fix sign of wchar_type_node.
...@@ -9,7 +14,7 @@ ...@@ -9,7 +14,7 @@
* decl.c (store_bindings): Simplify. * decl.c (store_bindings): Simplify.
(pop_from_top_level): Likewise. (pop_from_top_level): Likewise.
* pt.c (overload_template_name): Remove. * pt.c (overload_template_name): Remove.
(instantiate_decl): Don't call push_to_top_level if it's not (instantiate_decl): Don't call push_to_top_level if it's not
needed. needed.
2000-12-28 Mark Mitchell <mark@codesourcery.com> 2000-12-28 Mark Mitchell <mark@codesourcery.com>
...@@ -45,7 +50,7 @@ ...@@ -45,7 +50,7 @@
(fn_type_unification): Likewise. (fn_type_unification): Likewise.
(type_unification_real): Succeed after checking 'len' args. (type_unification_real): Succeed after checking 'len' args.
(most_specialized_instantiation): Lose explicit_args parm. (most_specialized_instantiation): Lose explicit_args parm.
* class.c (resolve_address_of_overloaded_function): Strip 'this', * class.c (resolve_address_of_overloaded_function): Strip 'this',
pass len. pass len.
2000-12-21 Jason Merrill <jason@redhat.com> 2000-12-21 Jason Merrill <jason@redhat.com>
...@@ -155,12 +160,12 @@ ...@@ -155,12 +160,12 @@
* class.c (check_field_decls): Don't special case anonymous * class.c (check_field_decls): Don't special case anonymous
fields in error messages. fields in error messages.
(note_name_declared_in_class): Use %D on diagnostic. (note_name_declared_in_class): Use %D on diagnostic.
* tree.c (pod_type_p): Use strip_array_types. * tree.c (pod_type_p): Use strip_array_types.
(cp_valid_lang_attribute): Likewise. (cp_valid_lang_attribute): Likewise.
* typeck.c (cp_type_quals): Strip arrays separately, to avoid * typeck.c (cp_type_quals): Strip arrays separately, to avoid
multiple evaluations. multiple evaluations.
(cp_has_mutable_p): Use strip_array_types. (cp_has_mutable_p): Use strip_array_types.
2000-12-07 Nathan Sidwell <nathan@codesourcery.com> 2000-12-07 Nathan Sidwell <nathan@codesourcery.com>
...@@ -233,7 +238,7 @@ ...@@ -233,7 +238,7 @@
2000-12-04 Jason Merrill <jason@redhat.com> 2000-12-04 Jason Merrill <jason@redhat.com>
* mangle.c (write_type): Mangle VECTOR_TYPE with "U8__vector". * mangle.c (write_type): Mangle VECTOR_TYPE with "U8__vector".
(write_builtin_type): Pass intSI_type_node and the like through (write_builtin_type): Pass intSI_type_node and the like through
type_for_mode. type_for_mode.
* method.c (process_overload_item): Mangle VECTOR_TYPEs with 'o'. * method.c (process_overload_item): Mangle VECTOR_TYPEs with 'o'.
Pass intSI_type_node and the like through type_for_mode. Pass intSI_type_node and the like through type_for_mode.
...@@ -242,7 +247,7 @@ ...@@ -242,7 +247,7 @@
* tree.c (walk_tree): Likewise. * tree.c (walk_tree): Likewise.
* error.c (dump_type): Likewise. * error.c (dump_type): Likewise.
(dump_type_prefix, dump_type_suffix): Don't bother with VECTOR_TYPE. (dump_type_prefix, dump_type_suffix): Don't bother with VECTOR_TYPE.
* Make-lang.in: Tweak top comment for emacs. * Make-lang.in: Tweak top comment for emacs.
(cp/TAGS): Restore. (cp/TAGS): Restore.
...@@ -259,7 +264,7 @@ ...@@ -259,7 +264,7 @@
* error.c (dump_function_decl): Use DECL_VIRTUAL_P, not * error.c (dump_function_decl): Use DECL_VIRTUAL_P, not
TYPE_POLYMORPHIC_P. TYPE_POLYMORPHIC_P.
* typeck.c (build_static_cast): Remove unused variable. * typeck.c (build_static_cast): Remove unused variable.
2000-12-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2000-12-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
...@@ -402,7 +407,7 @@ Thu Nov 23 02:16:47 2000 J"orn Rennecke <amylaar@redhat.com> ...@@ -402,7 +407,7 @@ Thu Nov 23 02:16:47 2000 J"orn Rennecke <amylaar@redhat.com>
* mangle.c (write_name): Use <unscoped-name> for names directly in * mangle.c (write_name): Use <unscoped-name> for names directly in
function scope. function scope.
(write_unscoped_name): Accept names directly in function scope. (write_unscoped_name): Accept names directly in function scope.
2000-11-20 Nathan Sidwell <nathan@codesourcery.com> 2000-11-20 Nathan Sidwell <nathan@codesourcery.com>
* lex.c (rid_to_yy, RID_EXPORT): Make unique keyword. * lex.c (rid_to_yy, RID_EXPORT): Make unique keyword.
......
/* Process declarations and variables for C compiler. /* Process declarations and variables for C compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
Free Software Foundation, Inc. 2001 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -173,6 +173,7 @@ static tree check_special_function_return_type ...@@ -173,6 +173,7 @@ static tree check_special_function_return_type
static tree push_cp_library_fn PARAMS ((enum tree_code, tree)); static tree push_cp_library_fn PARAMS ((enum tree_code, tree));
static tree build_cp_library_fn PARAMS ((tree, enum tree_code, tree)); static tree build_cp_library_fn PARAMS ((tree, enum tree_code, tree));
static void store_parm_decls PARAMS ((tree)); static void store_parm_decls PARAMS ((tree));
static int cp_missing_noreturn_ok_p PARAMS ((tree));
#if defined (DEBUG_CP_BINDING_LEVELS) #if defined (DEBUG_CP_BINDING_LEVELS)
static void indent PARAMS ((void)); static void indent PARAMS ((void));
...@@ -502,7 +503,7 @@ struct binding_level ...@@ -502,7 +503,7 @@ struct binding_level
#define current_binding_level \ #define current_binding_level \
(cfun \ (cfun \
? cp_function_chain->bindings \ ? cp_function_chain->bindings \
: scope_chain->bindings) : scope_chain->bindings)
/* The binding level of the current class, if any. */ /* The binding level of the current class, if any. */
...@@ -6304,6 +6305,7 @@ init_decl_processing () ...@@ -6304,6 +6305,7 @@ init_decl_processing ()
mark_lang_status = &mark_cp_function_context; mark_lang_status = &mark_cp_function_context;
lang_safe_from_p = &c_safe_from_p; lang_safe_from_p = &c_safe_from_p;
lang_dump_tree = &cp_dump_tree; lang_dump_tree = &cp_dump_tree;
lang_missing_noreturn_ok_p = &cp_missing_noreturn_ok_p;
cp_parse_init (); cp_parse_init ();
init_decl2 (); init_decl2 ();
...@@ -6618,7 +6620,7 @@ init_decl_processing () ...@@ -6618,7 +6620,7 @@ init_decl_processing ()
} }
abort_fndecl abort_fndecl
= build_library_fn_ptr ((flag_new_abi = build_library_fn_ptr ((flag_new_abi
? "__cxa_pure_virtual" ? "__cxa_pure_virtual"
: "__pure_virtual"), : "__pure_virtual"),
void_ftype); void_ftype);
...@@ -8908,7 +8910,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, ...@@ -8908,7 +8910,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
{ {
tree fns = TREE_OPERAND (orig_declarator, 0); tree fns = TREE_OPERAND (orig_declarator, 0);
tree args = TREE_OPERAND (orig_declarator, 1); tree args = TREE_OPERAND (orig_declarator, 1);
if (PROCESSING_REAL_TEMPLATE_DECL_P ()) if (PROCESSING_REAL_TEMPLATE_DECL_P ())
{ {
/* Something like `template <class T> friend void f<T>()'. */ /* Something like `template <class T> friend void f<T>()'. */
...@@ -8928,7 +8930,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals, ...@@ -8928,7 +8930,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
up an operator_name or PFUNCNAME within the current class up an operator_name or PFUNCNAME within the current class
(see template_id in parse.y). If the current class contains (see template_id in parse.y). If the current class contains
such a name, we'll get a COMPONENT_REF here. Undo that. */ such a name, we'll get a COMPONENT_REF here. Undo that. */
my_friendly_assert (TREE_TYPE (TREE_OPERAND (fns, 0)) my_friendly_assert (TREE_TYPE (TREE_OPERAND (fns, 0))
== current_class_type, 20001120); == current_class_type, 20001120);
fns = TREE_OPERAND (fns, 1); fns = TREE_OPERAND (fns, 1);
...@@ -9177,7 +9179,7 @@ build_ptrmemfunc_type (type) ...@@ -9177,7 +9179,7 @@ build_ptrmemfunc_type (type)
if (type == error_mark_node) if (type == error_mark_node)
return type; return type;
/* If a canonical type already exists for this type, use it. We use /* If a canonical type already exists for this type, use it. We use
this method instead of type_hash_canon, because it only does a this method instead of type_hash_canon, because it only does a
simple equality check on the list of field members. */ simple equality check on the list of field members. */
...@@ -10379,10 +10381,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10379,10 +10381,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
else if (RIDBIT_SETP (RID_TYPEDEF, specbits)) else if (RIDBIT_SETP (RID_TYPEDEF, specbits))
; ;
else if (decl_context == FIELD else if (decl_context == FIELD
/* C++ allows static class elements */ /* C++ allows static class elements */
&& RIDBIT_SETP (RID_STATIC, specbits)) && RIDBIT_SETP (RID_STATIC, specbits))
/* C++ also allows inlines and signed and unsigned elements, /* C++ also allows inlines and signed and unsigned elements,
but in those cases we don't come in here. */ but in those cases we don't come in here. */
; ;
else else
{ {
...@@ -10664,7 +10666,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10664,7 +10666,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
cp_error ("constructors may not be `%s'", cp_error ("constructors may not be `%s'",
IDENTIFIER_POINTER (TREE_VALUE (quals))); IDENTIFIER_POINTER (TREE_VALUE (quals)));
quals = NULL_TREE; quals = NULL_TREE;
} }
{ {
RID_BIT_TYPE tmp_bits; RID_BIT_TYPE tmp_bits;
memcpy (&tmp_bits, &specbits, sizeof (RID_BIT_TYPE)); memcpy (&tmp_bits, &specbits, sizeof (RID_BIT_TYPE));
...@@ -10982,7 +10984,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10982,7 +10984,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
{ {
incomplete_type_error (NULL_TREE, ctype); incomplete_type_error (NULL_TREE, ctype);
return error_mark_node; return error_mark_node;
} }
declarator = sname; declarator = sname;
} }
...@@ -11255,14 +11257,14 @@ friend declaration requires class-key, i.e. `friend %#T'", ...@@ -11255,14 +11257,14 @@ friend declaration requires class-key, i.e. `friend %#T'",
if (type != integer_type_node) if (type != integer_type_node)
{ {
decl_type_access_control (TYPE_NAME (type)); decl_type_access_control (TYPE_NAME (type));
/* A friendly class? */ /* A friendly class? */
if (current_class_type) if (current_class_type)
make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type)); make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type));
else else
cp_error ("trying to make class `%T' a friend of global scope", cp_error ("trying to make class `%T' a friend of global scope",
type); type);
type = void_type_node; type = void_type_node;
} }
} }
...@@ -11980,10 +11982,10 @@ grokparms (first_parm) ...@@ -11980,10 +11982,10 @@ grokparms (first_parm)
break; break;
decl = grokdeclarator (TREE_VALUE (decl), TREE_PURPOSE (decl), decl = grokdeclarator (TREE_VALUE (decl), TREE_PURPOSE (decl),
PARM, init != NULL_TREE, NULL_TREE); PARM, init != NULL_TREE, NULL_TREE);
if (! decl || TREE_TYPE (decl) == error_mark_node) if (! decl || TREE_TYPE (decl) == error_mark_node)
continue; continue;
type = TREE_TYPE (decl); type = TREE_TYPE (decl);
if (VOID_TYPE_P (type)) if (VOID_TYPE_P (type))
{ {
...@@ -11999,7 +12001,7 @@ grokparms (first_parm) ...@@ -11999,7 +12001,7 @@ grokparms (first_parm)
TREE_TYPE (decl) = error_mark_node; TREE_TYPE (decl) = error_mark_node;
} }
if (type != error_mark_node) if (type != error_mark_node)
{ {
/* Top-level qualifiers on the parameters are /* Top-level qualifiers on the parameters are
ignored for function types. */ ignored for function types. */
...@@ -14636,3 +14638,11 @@ identifier_global_value (t) ...@@ -14636,3 +14638,11 @@ identifier_global_value (t)
{ {
return IDENTIFIER_GLOBAL_VALUE (t); return IDENTIFIER_GLOBAL_VALUE (t);
} }
static int
cp_missing_noreturn_ok_p (decl)
tree decl;
{
/* A missing noreturn is ok for the `main' function. */
return MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment