re PR c++/6477 (Segfault on conflicting types in trivial code)

PR c++/6477
	* decl.c (follow_tag_typedef): Check if TYPE_NAME (original) is
	non-NULL first.

	* g++.dg/parse/typedef1.C: New test.

From-SVN: r52896
This commit is contained in:
Jakub Jelinek 2002-04-29 17:05:46 +02:00 committed by Jakub Jelinek
parent 3939c11f5c
commit cd24738009
4 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2002-04-29 Jakub Jelinek <jakub@redhat.com>
PR c++/6477
* decl.c (follow_tag_typedef): Check if TYPE_NAME (original) is
non-NULL first.
2002-04-29 Mark Mitchell <mark@codesourcery.com>
PR c++/6492

View File

@ -5337,6 +5337,8 @@ follow_tag_typedef (type)
tree original;
original = original_type (type);
if (! TYPE_NAME (original))
return NULL_TREE;
if (TYPE_IDENTIFIER (original) == TYPE_IDENTIFIER (type)
&& (CP_DECL_CONTEXT (TYPE_NAME (original))
== CP_DECL_CONTEXT (TYPE_NAME (type)))

View File

@ -1,3 +1,7 @@
2002-04-29 Jakub Jelinek <jakub@redhat.com>
* g++.dg/parse/typedef1.C: New test.
2002-04-29 Mark Mitchell <mark@codesourcery.com>
PR c++/6486

View File

@ -0,0 +1,3 @@
// PR c++/6477
typedef struct A_ *A; // { dg-error "previous declaration as" }
typedef struct A B; // { dg-error "conflicting types" }