Merge rev 1.8 (printf format error fixes) into Gcc 3.2.1 release.
This commit is contained in:
parent
d4053aa61b
commit
a83e5e4149
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107601
@ -3509,7 +3509,6 @@ duplicate_decls (newdecl, olddecl)
|
||||
except for any that we copy here from the old type. */
|
||||
DECL_ATTRIBUTES (newdecl)
|
||||
= (*targetm.merge_decl_attributes) (olddecl, newdecl);
|
||||
decl_attributes (&newdecl, DECL_ATTRIBUTES (newdecl), 0);
|
||||
|
||||
if (TREE_CODE (newdecl) == TEMPLATE_DECL)
|
||||
{
|
||||
@ -5769,6 +5768,12 @@ make_typename_type (context, name, complain)
|
||||
t = lookup_field (context, name, 0, 1);
|
||||
if (t)
|
||||
{
|
||||
if (TREE_CODE (t) != TYPE_DECL)
|
||||
{
|
||||
if (complain & tf_error)
|
||||
error ("no type named `%#T' in `%#T'", name, context);
|
||||
return error_mark_node;
|
||||
}
|
||||
if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl))
|
||||
t = TREE_TYPE (t);
|
||||
if (IMPLICIT_TYPENAME_P (t))
|
||||
@ -7337,7 +7342,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
|
||||
switch (TREE_CODE (decl))
|
||||
{
|
||||
case TYPE_DECL:
|
||||
error ("typedef `%D' is initialized", decl);
|
||||
error ("typedef `%D' is initialized (use __typeof__ instead)", decl);
|
||||
initialized = 0;
|
||||
break;
|
||||
|
||||
@ -8035,6 +8040,12 @@ maybe_inject_for_scope_var (decl)
|
||||
{
|
||||
if (!DECL_NAME (decl))
|
||||
return;
|
||||
|
||||
/* Declarations of __FUNCTION__ and its ilk appear magically when
|
||||
the variable is first used. If that happens to be inside a
|
||||
for-loop, we don't want to do anything special. */
|
||||
if (DECL_PRETTY_FUNCTION_P (decl))
|
||||
return;
|
||||
|
||||
if (current_binding_level->is_for_scope)
|
||||
{
|
||||
@ -10069,6 +10080,16 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
||||
next = 0;
|
||||
break;
|
||||
|
||||
case TEMPLATE_DECL:
|
||||
/* Sometimes, we see a template-name used as part of a
|
||||
decl-specifier like in
|
||||
std::allocator alloc;
|
||||
Handle that gracefully. */
|
||||
error ("invalid use of template-name '%E' in a declarator",
|
||||
decl);
|
||||
return error_mark_node;
|
||||
break;
|
||||
|
||||
default:
|
||||
internal_error ("`%D' as declarator", decl);
|
||||
}
|
||||
@ -10709,19 +10730,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
||||
|
||||
type = create_array_type_for_decl (dname, type, size);
|
||||
|
||||
/* VLAs never work as fields. */
|
||||
if (decl_context == FIELD && !processing_template_decl
|
||||
&& TREE_CODE (type) == ARRAY_TYPE
|
||||
&& TYPE_DOMAIN (type) != NULL_TREE
|
||||
&& !TREE_CONSTANT (TYPE_MAX_VALUE (TYPE_DOMAIN (type))))
|
||||
{
|
||||
error ("size of member `%D' is not constant", dname);
|
||||
/* Proceed with arbitrary constant size, so that offset
|
||||
computations don't get confused. */
|
||||
type = create_array_type_for_decl (dname, TREE_TYPE (type),
|
||||
integer_one_node);
|
||||
}
|
||||
|
||||
ctype = NULL_TREE;
|
||||
}
|
||||
break;
|
||||
@ -11028,8 +11036,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
||||
pop_decl_namespace ();
|
||||
else if (friendp && (TREE_COMPLEXITY (declarator) < 2))
|
||||
/* Don't fall out into global scope. Hides real bug? --eichin */ ;
|
||||
else if (! IS_AGGR_TYPE_CODE
|
||||
(TREE_CODE (TREE_OPERAND (declarator, 0))))
|
||||
else if (!TREE_OPERAND (declarator, 0)
|
||||
|| !IS_AGGR_TYPE_CODE
|
||||
(TREE_CODE (TREE_OPERAND (declarator, 0))))
|
||||
;
|
||||
else if (TREE_COMPLEXITY (declarator) == current_class_depth)
|
||||
{
|
||||
@ -11209,6 +11218,14 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
|
||||
type = error_mark_node;
|
||||
}
|
||||
|
||||
if (decl_context == FIELD
|
||||
&& !processing_template_decl
|
||||
&& variably_modified_type_p (type))
|
||||
{
|
||||
error ("data member may not have variably modified type `%T'", type);
|
||||
type = error_mark_node;
|
||||
}
|
||||
|
||||
if (explicitp == 1 || (explicitp && friendp))
|
||||
{
|
||||
/* [dcl.fct.spec] The explicit specifier shall only be used in
|
||||
@ -14110,6 +14127,10 @@ finish_destructor_body ()
|
||||
{
|
||||
tree exprstmt;
|
||||
|
||||
/* Any return from a destructor will end up here; that way all base
|
||||
and member cleanups will be run when the function returns. */
|
||||
add_stmt (build_stmt (LABEL_STMT, dtor_label));
|
||||
|
||||
/* And perform cleanups for our bases and members. */
|
||||
perform_base_cleanups ();
|
||||
|
||||
@ -14185,14 +14206,7 @@ void
|
||||
finish_function_body (compstmt)
|
||||
tree compstmt;
|
||||
{
|
||||
if (processing_template_decl)
|
||||
/* Do nothing now. */;
|
||||
else if (DECL_DESTRUCTOR_P (current_function_decl))
|
||||
/* Any return from a destructor will end up here. Put it before the
|
||||
cleanups so that an explicit return doesn't duplicate them. */
|
||||
add_stmt (build_stmt (LABEL_STMT, dtor_label));
|
||||
|
||||
/* Close the block; in a destructor, run the member cleanups. */
|
||||
/* Close the block. */
|
||||
finish_compound_stmt (0, compstmt);
|
||||
|
||||
if (processing_template_decl)
|
||||
|
Loading…
Reference in New Issue
Block a user