Commit 8d590b9c by Paolo Carlini Committed by Paolo Carlini

re PR c++/58700 (ICE declaring static bit-field)

/cp
2013-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58700
	* decl.c (grokdeclarator): Don't try to pass declarator->id_loc
	to build_lang_decl_loc when declarator is null.

/testsuite
2013-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58700
	* g++.dg/parse/bitfield4.C: New.

From-SVN: r205389
parent 160051af
2013-11-26 Paolo Carlini <paolo.carlini@oracle.com> 2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58700
* decl.c (grokdeclarator): Don't try to pass declarator->id_loc
to build_lang_decl_loc when declarator is null.
2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
* cvt.c (cp_convert_and_check): Avoid calling cp_convert * cvt.c (cp_convert_and_check): Avoid calling cp_convert
unnecessarily. unnecessarily.
......
...@@ -10637,7 +10637,9 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -10637,7 +10637,9 @@ grokdeclarator (const cp_declarator *declarator,
{ {
/* C++ allows static class members. All other work /* C++ allows static class members. All other work
for this is done by grokfield. */ for this is done by grokfield. */
decl = build_lang_decl_loc (declarator->id_loc, decl = build_lang_decl_loc (declarator
? declarator->id_loc
: input_location,
VAR_DECL, unqualified_id, type); VAR_DECL, unqualified_id, type);
set_linkage_for_static_data_member (decl); set_linkage_for_static_data_member (decl);
/* Even if there is an in-class initialization, DECL /* Even if there is an in-class initialization, DECL
......
2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58700
* g++.dg/parse/bitfield4.C: New.
2013-11-26 Richard Biener <rguenther@suse.de> 2013-11-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/59287 PR tree-optimization/59287
......
// PR c++/58700
struct A
{
static int : 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