aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-11-29 22:04:04 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2007-11-29 22:04:04 +0100
commit7a547b936c01964cfcc9543db0d86c008f7269da (patch)
tree6d76a7a037f9bac1f6c110f41cfb1978b264a6a1 /gcc/cp/parser.c
parent10650fbb88871139f242597b1f081041868c43f6 (diff)
downloadgcc-7a547b936c01964cfcc9543db0d86c008f7269da.zip
gcc-7a547b936c01964cfcc9543db0d86c008f7269da.tar.gz
gcc-7a547b936c01964cfcc9543db0d86c008f7269da.tar.bz2
re PR c++/34267 (ICE applying __decltype to name of template class)
PR c++/34267 PR c++/34268 * parser.c (cp_parser_decltype): Don't call finish_id_expression on ~type. * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs and ~type early. * g++.dg/cpp0x/decltype7.C: New test. * g++.dg/cpp0x/decltype8.C: New test. From-SVN: r130519
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 8e16d22..7b173f0 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -8512,10 +8512,12 @@ cp_parser_decltype (cp_parser *parser)
/*check_dependency=*/true,
/*ambiguous_decls=*/NULL);
- if (expr
+ if (expr
&& expr != error_mark_node
&& TREE_CODE (expr) != TEMPLATE_ID_EXPR
&& TREE_CODE (expr) != TYPE_DECL
+ && (TREE_CODE (expr) != BIT_NOT_EXPR
+ || !TYPE_P (TREE_OPERAND (expr, 0)))
&& cp_lexer_peek_token (parser->lexer)->type == CPP_CLOSE_PAREN)
{
/* Complete lookup of the id-expression. */