Commit bdd0bd5c by Marek Polacek Committed by Marek Polacek

PR c++/88222 - ICE with bit-field with invalid type.

	* decl.c (grokdeclarator): Check if declarator is null.

	* g++.dg/ext/flexary31.C: New test.

From-SVN: r266581
parent 9638e3ef
2018-11-28 Marek Polacek <polacek@redhat.com>
PR c++/88222 - ICE with bit-field with invalid type.
* decl.c (grokdeclarator): Check if declarator is null.
2018-11-28 Jakub Jelinek <jakub@redhat.com>
PR c++/87476
......
......@@ -12221,7 +12221,7 @@ grokdeclarator (const cp_declarator *declarator,
if (in_system_header_at (input_location))
/* Do not warn on flexible array members in system
headers because glibc uses them. */;
else if (name)
else if (name && declarator)
pedwarn (declarator->id_loc, OPT_Wpedantic,
"ISO C++ forbids flexible array member %qs", name);
else
......
2018-11-28 Marek Polacek <polacek@redhat.com>
PR c++/88222 - ICE with bit-field with invalid type.
* g++.dg/ext/flexary31.C: New test.
2018-11-28 David Edelsohn <dje.gcc@gmail.com>
* g++.dg/debug/dwarf2/pr86900.C: XFAIL AIX.
......
// PR c++/88222
// { dg-options -Wno-pedantic }
typedef char a[];
class S {
a : 4; // { dg-error "bit-field" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment