From: Kai Tietz Date: Thu, 20 Feb 2014 16:02:24 +0000 (+0100) Subject: re PR c++/58873 ([c++11] ICE with __underlying_type for broken enum) X-Git-Tag: releases/gcc-4.9.0~801 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1dbbe422e62d40b987b7e241cd571ba19dd3872;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: r207961 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7231155bb325..602ab94a8a6a 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 98182138e241..4673f78051a8 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -23165,6 +23165,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);