diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c9314be5c13..3ffc400c1cb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-07-11 Paolo Carlini + + PR c++/32560 + * parser.c (cp_parser_make_indirect_declarator): When the + the code argument is ERROR_MARK return cp_error_declarator. + 2007-07-09 Geoffrey Keating PR 32617 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 0bd33d692a1..b49b9f8279c 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2702,6 +2702,9 @@ cp_parser_make_indirect_declarator (enum tree_code code, tree class_type, cp_cv_quals cv_qualifiers, cp_declarator *target) { + if (code == ERROR_MARK) + return cp_error_declarator; + if (code == INDIRECT_REF) if (class_type == NULL_TREE) return make_pointer_declarator (cv_qualifiers, target); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6463310b59c..6eda430f559 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-11 Paolo Carlini + + PR c++/32560 + * g++.dg/template/decl3.C: New. + 2007-07-09 Geoffrey Keating PR 32617 diff --git a/gcc/testsuite/g++.dg/template/decl3.C b/gcc/testsuite/g++.dg/template/decl3.C new file mode 100644 index 00000000000..7f938507603 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/decl3.C @@ -0,0 +1,8 @@ +// c++/32560 + +namespace N {} + +template struct A +{ + int A; // { dg-error "namespace|argument|before" } +};