re PR c++/55446 (array new with size zero vanishes from object code)
/cp 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55446 * init.c (build_vec_init): Do not early return error_mark_mode when integer_all_onesp (maxindex). /testsuite 2012-11-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55446 * g++.dg/init/new41.C: New. From-SVN: r193786
This commit is contained in:
parent
b058098bac
commit
686c35243b
|
@ -1,3 +1,9 @@
|
|||
2012-11-24 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/55446
|
||||
* init.c (build_vec_init): Do not early return error_mark_mode
|
||||
when integer_all_onesp (maxindex).
|
||||
|
||||
2012-11-05 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
Backported from mainline
|
||||
|
|
|
@ -3151,8 +3151,7 @@ build_vec_init (tree base, tree maxindex, tree init,
|
|||
if (TREE_CODE (atype) == ARRAY_TYPE && TYPE_DOMAIN (atype))
|
||||
maxindex = array_type_nelts (atype);
|
||||
|
||||
if (maxindex == NULL_TREE || maxindex == error_mark_node
|
||||
|| integer_all_onesp (maxindex))
|
||||
if (maxindex == NULL_TREE || maxindex == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
if (explicit_value_init_p)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2012-11-24 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/55446
|
||||
* g++.dg/init/new41.C: New.
|
||||
|
||||
2012-11-24 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/55314
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
// PR c++/55446
|
||||
// { dg-do run }
|
||||
|
||||
struct S
|
||||
{
|
||||
S() { }
|
||||
};
|
||||
|
||||
int n = 1;
|
||||
|
||||
void* operator new[](__SIZE_TYPE__)
|
||||
{
|
||||
n = -1;
|
||||
return &n;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
new S[0];
|
||||
if (n != -1)
|
||||
__builtin_abort();
|
||||
}
|
Loading…
Reference in New Issue