re PR c++/46282 ([C++0x] ICE: SIGSEGV in grokbitfield (decl2.c:1054))
PR c++/46282 * decl2.c (grokbitfield): Handle type-dependent width. From-SVN: r170600
This commit is contained in:
parent
f2ca11ca97
commit
faa9e9bfca
@ -1,3 +1,8 @@
|
||||
2011-03-01 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/46282
|
||||
* decl2.c (grokbitfield): Handle type-dependent width.
|
||||
|
||||
2011-02-28 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/47873
|
||||
|
@ -1052,7 +1052,8 @@ grokbitfield (const cp_declarator *declarator,
|
||||
if (width != error_mark_node)
|
||||
{
|
||||
/* The width must be an integer type. */
|
||||
if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width)))
|
||||
if (!type_dependent_expression_p (width)
|
||||
&& !INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width)))
|
||||
error ("width of bit-field %qD has non-integral type %qT", value,
|
||||
TREE_TYPE (width));
|
||||
DECL_INITIAL (value) = width;
|
||||
|
@ -1,3 +1,7 @@
|
||||
2011-03-01 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* g++.dg/cpp0x/regress/bitfield-err1.C: New.
|
||||
|
||||
2011-03-01 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/47890
|
||||
|
9
gcc/testsuite/g++.dg/cpp0x/regress/bitfield-err1.C
Normal file
9
gcc/testsuite/g++.dg/cpp0x/regress/bitfield-err1.C
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/46282
|
||||
// { dg-options -std=c++0x }
|
||||
|
||||
template<int>
|
||||
class A
|
||||
{
|
||||
A : i() {} // { dg-message "" }
|
||||
int i;
|
||||
};
|
Loading…
Reference in New Issue
Block a user