summaryrefslogtreecommitdiffstats
path: root/gcc/cp
diff options
context:
space:
mode:
authorgerald <gerald@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-22 18:44:21 +0000
committergerald <gerald@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-22 18:44:21 +0000
commit53de4738d7adcb7426e40dc23dfe269763c14cdb (patch)
tree4a947073d54987aecf89197e7a51238428066e83 /gcc/cp
parentcd003521b51ce4c9c5b5e393bb127cf2d27137d2 (diff)
downloadppe42-gcc-53de4738d7adcb7426e40dc23dfe269763c14cdb.tar.gz
ppe42-gcc-53de4738d7adcb7426e40dc23dfe269763c14cdb.zip
* parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore):
New nonterminals. (data_def, component_decl): Add reductions to bad_decl. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40752 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parse.y23
2 files changed, 30 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d2c9217b29e..bdce0cea9ca 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2001-03-22 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+ based on an idea from Joe Buck <jbuck@synopsys.com>
+
+ * parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore):
+ New nonterminals.
+ (data_def, component_decl): Add reductions to bad_decl.
+
2001-03-22 Jakub Jelinek <jakub@redhat.com>
* method.c (do_build_assign_ref): Don't use build_modify_expr for
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 59ad4e61064..3d4ab4400f6 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -733,6 +733,7 @@ datadef:
| error ';'
| error '}'
| ';'
+ | bad_decl
;
ctor_initializer_opt:
@@ -2590,6 +2591,8 @@ component_decl:
$$ = finish_member_class_template ($2.t);
finish_template_decl ($1);
}
+ | bad_decl
+ { $$ = NULL_TREE; }
;
component_decl_1:
@@ -3761,6 +3764,26 @@ bad_parm:
}
;
+bad_decl:
+ IDENTIFIER template_arg_list_ignore IDENTIFIER arg_list_ignore ';'
+ {
+ cp_error("'%D' is used as a type, but is not defined as a type.", $1);
+ $3 = error_mark_node;
+ }
+ ;
+
+template_arg_list_ignore:
+ '<' template_arg_list_opt template_close_bracket
+ { }
+ | /* empty */
+ ;
+
+arg_list_ignore:
+ '(' nonnull_exprlist ')'
+ { }
+ | /* empty */
+ ;
+
exception_specification_opt:
/* empty */ %prec EMPTY
{ $$ = NULL_TREE; }
OpenPOWER on IntegriCloud