diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-12-27 19:03:16 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-12-27 19:03:16 +0000 |
commit | c827f22fb9b47c71259b389e1c61876f416d121a (patch) | |
tree | c995eeab2f10532b3a098e972471d797c0bf2f02 /gcc/cp/decl.c | |
parent | 5168743153a7eb669b5d6ac4b14f337bf508398d (diff) | |
download | gcc-c827f22fb9b47c71259b389e1c61876f416d121a.zip gcc-c827f22fb9b47c71259b389e1c61876f416d121a.tar.gz gcc-c827f22fb9b47c71259b389e1c61876f416d121a.tar.bz2 |
re PR c++/19149 (seg fault on invalid code)
PR c++/19149
* decl.c (check_tag_decl): Robustify.
PR c++/19149
* g++.dg/parse/error23.C: New test.
From-SVN: r92648
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index be1addd..991996b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3514,7 +3514,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs) return NULL_TREE; } - if (TYPE_P (declspecs->type) + if (declspecs->type + && TYPE_P (declspecs->type) && ((TREE_CODE (declspecs->type) != TYPENAME_TYPE && IS_AGGR_TYPE (declspecs->type)) || TREE_CODE (declspecs->type) == ENUMERAL_TYPE)) |