This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/23480] default-initializing variable size array new expression for basic types does not work


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-20 02:30 -------
Testcase which was attached on PR 20427:


#include <iostream>
void f(int n)
{
    int * a = new int [n] () ;
    for (int i = 0; i < n; ++i)
    {
        std::cout << a[i]++ << ' ';
    }
    std::cout << '\n';
    delete[] a;
}

int main()
{
    f(5);
    f(5);
    f(5);
    f(5);
}

Which shows the issue more clearer.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23480


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]