diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-08 11:09:13 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-08 11:09:13 +0000 |
commit | f7d1c2eaa5f2ac6b0e3de2a2a03c7bbd47ab2a59 (patch) | |
tree | d807bfd40a0af5e5e71210780fe36ea13da24aee /gcc/cp | |
parent | aa2728665e442736d6e84d2bf5eda5245a6989e3 (diff) | |
download | gcc-f7d1c2eaa5f2ac6b0e3de2a2a03c7bbd47ab2a59.tar.gz |
PR c++/19894
* pt.c (tsubst): Reject pointer-to-member of type void.
* g++.dg/template/ptrmem15.C: New test.
PR c++/20563
* parser.c (cp_parser_label_declaration): Deal with invalid/missing
identifiers.
* g++.dg/ext/label4.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100754 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/parser.c | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 |
3 files changed, 19 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 87a9da7075d..c15f9b40433 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2005-06-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + + PR c++/19894 + * pt.c (tsubst): Reject pointer-to-member of type void. + + PR c++/20563 + * parser.c (cp_parser_label_declaration): Deal with invalid/missing + identifiers. + 2005-06-07 Nathan Sidwell <nathan@codesourcery.com> * cp-tree.def (DEFAULT_ARG): Adjust documentation. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 24cb027d327..cb389d24afe 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -14392,7 +14392,10 @@ cp_parser_label_declaration (cp_parser* parser) /* Look for an identifier. */ identifier = cp_parser_identifier (parser); - /* Declare it as a lobel. */ + /* If we failed, stop. */ + if (identifier == error_mark_node) + break; + /* Declare it as a label. */ finish_label_decl (identifier); /* If the next token is a `;', stop. */ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f7eb93576ec..292dc0ae78b 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7271,7 +7271,12 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) { if (complain & tf_error) error ("creating pointer to member reference type %qT", type); - + return error_mark_node; + } + if (TREE_CODE (type) == VOID_TYPE) + { + if (complain & tf_error) + error ("creating pointer to member of type void"); return error_mark_node; } gcc_assert (TREE_CODE (type) != METHOD_TYPE); |