| Submitter | François Dumont |
|---|---|
| Date | Dec. 1, 2010, 8:59 p.m. |
| Message ID | <4CF6B71A.6000804@free.fr> |
| Download | mbox | patch |
| Permalink | /patch/73910/ |
| State | New |
| Headers | show |
Comments
On 1 December 2010 20:59, François Dumont wrote: > Attached patch applied. > > 2010-11-22 François Dumont <francois.cppdevs@free.fr> > > * testsuite/23_containers/deque/cons/2.cc: Fix to explicitely invoke > the copy construtor with or without C++0x mode. I would have asked you to fix "explicitly" and "constructor" before approving it for checkin, but I like the solution that avoids testing for C++0x mode. Thanks for finding and fixing it.
Patch
Index: testsuite/23_containers/vector/cons/4.cc =================================================================== --- testsuite/23_containers/vector/cons/4.cc (revision 167225) +++ testsuite/23_containers/vector/cons/4.cc (working copy) @@ -50,7 +50,8 @@ // run test try { - X a(7); + T ref; + X a(7, ref); VERIFY(false); } catch (...) Index: testsuite/23_containers/deque/cons/2.cc =================================================================== --- testsuite/23_containers/deque/cons/2.cc (revision 167225) +++ testsuite/23_containers/deque/cons/2.cc (working copy) @@ -454,7 +454,8 @@ // test try { - X a(7); + T ref; + X a(7, ref); VERIFY( false ); } catch (...)
Attached patch applied. 2010-11-22 François Dumont <francois.cppdevs@free.fr> * testsuite/23_containers/deque/cons/2.cc: Fix to explicitely invoke the copy construtor with or without C++0x mode. * testsuite/23_containers/vector/cons/4.cc: Likewise. On 11/29/2010 10:45 PM, Paolo Carlini wrote: > Hi, > >> This is some feedback on tests run in C++0x mode with or without >> debug mode. >> >> First failures without debug mode: >> >> 23_containers/vector/cons/4.cc >> 23_containers/deque/cons/2.cc >> >> The code was calling vector and deque constructor taking a size. >> Before C++0x it meant contruct N instances as the copy of a default >> constructed instance. In C++0x it means contruct N default constructed >> instance. I change the code to make copy constructor invocation explicit. >> > The changes to the testcases are fine. Please post the ChangeLog entry > and send the patch to gcc-patches too. In principle it would be a good > idea to also add a testcase for the behavior mandated by C++0x in terms > of number of copies. At the time, I think I added C++0x testcases, but > only checking that default-constructible, non-copy-constructible types > are fine. >