aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorSimon Martin <simartin@users.sourceforge.net>2008-09-30 19:25:35 +0000
committerSimon Martin <simartin@gcc.gnu.org>2008-09-30 19:25:35 +0000
commitdcbdf612f562c76af993b0cff4fb9aef9a5214f3 (patch)
tree64c05b95e57cc2cb919348d53b53f03970e9d25a /gcc/cp
parent61b70fcb8c1015ea3ab5c95aef41b23100579ec0 (diff)
downloadgcc-dcbdf612f562c76af993b0cff4fb9aef9a5214f3.zip
gcc-dcbdf612f562c76af993b0cff4fb9aef9a5214f3.tar.gz
gcc-dcbdf612f562c76af993b0cff4fb9aef9a5214f3.tar.bz2
re PR c++/37555 (ICE with invalid typedef)
gcc/cp/ 2008-09-30 Simon Martin <simartin@users.sourceforge.net> PR c++/37555 PR c++/37556 * decl.c (grokdeclarator): Set the type for typedefs to a nested-name-specifier to error_mark_node. gcc/testsuite/ 2008-09-30 Simon Martin <simartin@users.sourceforge.net> PR c++/37555 * g++.dg/parse/error32.C: New test. PR c++/37556 * g++.dg/parse/error33.C: New test. From-SVN: r140794
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5e5c742..0e80343 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-30 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/37555
+ PR c++/37556
+ * decl.c (grokdeclarator): Set the type for typedefs to a
+ nested-name-specifier to error_mark_node.
+
2008-09-30 Paolo Bonzini <bonzini@gnu.org>
* parser.c (cp_parser_selection_statement): Implement here the
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 82e0bba..be28e78 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8679,8 +8679,10 @@ grokdeclarator (const cp_declarator *declarator,
decl = build_lang_decl (TYPE_DECL, unqualified_id, type);
else
decl = build_decl (TYPE_DECL, unqualified_id, type);
- if (id_declarator && declarator->u.id.qualifying_scope)
+ if (id_declarator && declarator->u.id.qualifying_scope) {
error ("%Jtypedef name may not be a nested-name-specifier", decl);
+ TREE_TYPE (decl) = error_mark_node;
+ }
if (decl_context != FIELD)
{