mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/58207 (ICE in sort_constexpr_mem_initializers due to out of bounds vector access)
/cp 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58207 * semantics.c (sort_constexpr_mem_initializers): Robustify loop. /testsuite 2014-04-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58207 * g++.dg/cpp0x/constexpr-ice15.C: New. From-SVN: r209128
This commit is contained in:
parent
e005b75359
commit
9119c7faba
|
|
@ -1,3 +1,8 @@
|
||||||
|
2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
|
PR c++/58207
|
||||||
|
* semantics.c (sort_constexpr_mem_initializers): Robustify loop.
|
||||||
|
|
||||||
2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
|
2014-04-04 Patrick Palka <patrick@parcs.ath.cx>
|
||||||
|
|
||||||
PR c++/44613
|
PR c++/44613
|
||||||
|
|
|
||||||
|
|
@ -7720,8 +7720,8 @@ sort_constexpr_mem_initializers (tree type, vec<constructor_elt, va_gc> *v)
|
||||||
{
|
{
|
||||||
tree pri = CLASSTYPE_PRIMARY_BINFO (type);
|
tree pri = CLASSTYPE_PRIMARY_BINFO (type);
|
||||||
tree field_type;
|
tree field_type;
|
||||||
constructor_elt elt;
|
unsigned i;
|
||||||
int i;
|
constructor_elt *ce;
|
||||||
|
|
||||||
if (pri)
|
if (pri)
|
||||||
field_type = BINFO_TYPE (pri);
|
field_type = BINFO_TYPE (pri);
|
||||||
|
|
@ -7732,14 +7732,14 @@ sort_constexpr_mem_initializers (tree type, vec<constructor_elt, va_gc> *v)
|
||||||
|
|
||||||
/* Find the element for the primary base or vptr and move it to the
|
/* Find the element for the primary base or vptr and move it to the
|
||||||
beginning of the vec. */
|
beginning of the vec. */
|
||||||
vec<constructor_elt, va_gc> &vref = *v;
|
for (i = 0; vec_safe_iterate (v, i, &ce); ++i)
|
||||||
for (i = 0; ; ++i)
|
if (TREE_TYPE (ce->index) == field_type)
|
||||||
if (TREE_TYPE (vref[i].index) == field_type)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i > 0)
|
if (i > 0 && i < vec_safe_length (v))
|
||||||
{
|
{
|
||||||
elt = vref[i];
|
vec<constructor_elt, va_gc> &vref = *v;
|
||||||
|
constructor_elt elt = vref[i];
|
||||||
for (; i > 0; --i)
|
for (; i > 0; --i)
|
||||||
vref[i] = vref[i-1];
|
vref[i] = vref[i-1];
|
||||||
vref[0] = elt;
|
vref[0] = elt;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2014-04-04 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
|
PR c++/58207
|
||||||
|
* g++.dg/cpp0x/constexpr-ice15.C: New.
|
||||||
|
|
||||||
2014-04-04 Jan Hubicka <hubicka@ucw.cz>
|
2014-04-04 Jan Hubicka <hubicka@ucw.cz>
|
||||||
|
|
||||||
PR ipa/59626
|
PR ipa/59626
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
// PR c++/58207
|
||||||
|
// { dg-do compile { target c++11 } }
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
virtual bool foo ();
|
||||||
|
};
|
||||||
|
|
||||||
|
struct B : public A
|
||||||
|
{
|
||||||
|
constexpr B () : A (&::n) {} // { dg-error "declared" }
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue