From: Kai Tietz Date: Thu, 20 Feb 2014 16:04:37 +0000 (+0100) Subject: re PR c++/58873 ([c++11] ICE with __underlying_type for broken enum) X-Git-Tag: releases/gcc-4.7.4~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=340f0354ef648718aa2cd87f186e1684817cce70;p=thirdparty%2Fgcc.git re PR c++/58873 ([c++11] ICE with __underlying_type for broken enum) PR c++/58873 * parser.c (cp_parser_functional_cast): Treat NULL_TREE valued type argument as error_mark_node. From-SVN: r207963 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 00982df2e6eb..fbcba47d9bf8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2014-02-20 Kai Tietz + PR c++/58873 + * parser.c (cp_parser_functional_cast): Treat NULL_TREE + valued type argument as error_mark_node. + PR c++/58835 * semantics.c (finish_fname): Handle error_mark_node. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c230d90c63d4..fe8c84df7955 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -21419,6 +21419,9 @@ cp_parser_functional_cast (cp_parser* parser, tree type) tree cast; bool nonconst_p; + if (!type) + type = error_mark_node; + if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS);