This is the mail archive of the gcc@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]

Quick test..


Hi, someone posted the following code earlier (since like a twit, I
deleted it, can't follow up on it!) 

#include <memory>
#include <cstdlib>
#include <iostream>

template <int i = 20> char *
xx (const auto_ptr<char> &c = auto_ptr<char>(new char[i]))
{
    return strncpy (c.get (), "Hello World!", i);
}

int
main ()
{
    cout << xx () << endl;
}

This doesn't cause a sig-11 error like the guy reported for his v1.03a
egcs compiler. Rather, it comes up with the following error:

test.c:7: parse error before `&'
test.c: In function `int main()':
test.c:15: incomplete type unification
test.c:15: no matching function for call to `xx ()'
test.c:16: confused by earlier errors, bailing out

No sig-11 error there, so obviously the guy who reported this needs to
check his hardware out. 

Cheers,
Alex.

---
 /\_/\  Legalise cannabis now! 
( o.o ) Grow some cannabis today! 
 > ^ <  Peace, Love, Unity and Respect to all.

Check out http://www.tahallah.demon.co.uk



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