c-typeck.c (build_indirect_ref): Use COMPLETE_OR_VOID_TYPE_P and VOID_TYPE_P.

* c-typeck.c (build_indirect_ref): Use COMPLETE_OR_VOID_TYPE_P
	and VOID_TYPE_P.

From-SVN: r34835
This commit is contained in:
Zack Weinberg 2000-07-02 19:19:18 +00:00 committed by Zack Weinberg
parent bc6e9a0a86
commit baae9b65ed
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2000-07-02 Zack Weinberg <zack@wolery.cumb.org>
* c-typeck.c (build_indirect_ref): Use COMPLETE_OR_VOID_TYPE_P
and VOID_TYPE_P.
2000-07-02 Jakub Jelinek <jakub@redhat.com>
* cpplib.h (struct cpp_reader): New field include_depth.

View File

@ -1217,12 +1217,12 @@ build_indirect_ref (ptr, errorstring)
register tree ref = build1 (INDIRECT_REF,
TYPE_MAIN_VARIANT (t), pointer);
if (!COMPLETE_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE)
if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE)
{
error ("dereferencing pointer to incomplete type");
return error_mark_node;
}
if (TREE_CODE (t) == VOID_TYPE && skip_evaluation == 0)
if (VOID_TYPE_P (t) && skip_evaluation == 0)
warning ("dereferencing `void *' pointer");
/* We *must* set TREE_READONLY when dereferencing a pointer to const,