diff mbox

[c++] : Fix PR/58873 [4.7/4.8/4.9 Regression] [c++11] ICE with __underlying_type for broken enum

Message ID CAEwic4aJjQcCLb0FuNBVHNR6cfE5kE8L_8nFwbSQcook-Lehng@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Feb. 20, 2014, 3 p.m. UTC
Hi,

Issue here is that the argument type gets NULL for function-call of
cp_parser_functional_cast.  This invalid type is the result of
cp_parser_simple_type_specifier call.

2014-02-20  Kai Tietz  <ktietz@redhat.com>

    PR c++/58873
    * parser.c (cp_parser_functional_cast): Treat NULL_TREE
    valued type argument as error_mark_node.

Regression tested for x86_64-unknown-linux-gnu, and i686-w64-mingw32.
Ok for apply?

Regards,
Kai

Comments

Jason Merrill Feb. 20, 2014, 3:27 p.m. UTC | #1
OK.

Jason
Jakub Jelinek Feb. 20, 2014, 3:51 p.m. UTC | #2
On Thu, Feb 20, 2014 at 10:27:18AM -0500, Jason Merrill wrote:
> OK.

Please include the testcase from the PR into the testsuite though.

	Jakub
diff mbox

Patch

Index: parser.c
===================================================================
--- parser.c    (Revision 207953)
+++ parser.c    (Arbeitskopie)
@@ -23165,6 +23165,9 @@  cp_parser_functional_cast (cp_parser* parser, tree
   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);