g++ bug?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <map>
#include <string>

void TestTest
(
    bool call2ndTime,
    std::map <int, unsigned char> a = {{}},
    std::map <int, std::string> b = {{}}
)
{
    if(call2ndTime)			
        TestTest(false, std::move(a), std::move(b));
}

int main()
{
    TestTest(true);
}

I get *** glibc detected *** ./myfile: free(): invalid pointer: 0x00000000017cd048 ***

gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
Use a non-obsolete version of the compiler/library (GCC 5.1 or later).
http://coliru.stacked-crooked.com/a/fca3a4b51c8118f3

GCC 4.4.7 is not maintained; not even for bug-fixes.
Topic archived. No new replies allowed.