This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: Containers default initialization


On 10/06/17 16:44 +0200, François Dumont wrote:
On 08/06/2017 15:22, Jonathan Wakely wrote:
Can't we just have one file per container type (maybe just called
default_init.cc) which tests default-initialization in test01() and
value-initialization in a test02() function?

While working on this weird behavior I wanted to always test the 2 types of init. If they were in the same file the 1st failure would stop the tests. Do you really want them in the same file ?

But the desired situation is that there are no failures, so the tests
don't stop. So they can be in the same file. If either case starts to
fail then we need to investigate and fix it, which is true whether
it's in one file or two.

But is there any dg-xxx flag to put to indicate a failing test for known reason ? Or should I simply keep the test on my desktop waiting for the compiler fix ?

You can use the following to make the expected result XFAIL:

{ dg-xfail-run-if "PR c++/65816" { *-*-* } }

When the bug gets fixed the tests will start to XPASS and we can
remove that directive.

The DejaGnu directives supported by the GCC testsuites are documented
at https://gcc.gnu.org/onlinedocs/gccint/Directives.html

Attach is the new patch tested under Linux x86_64 normal mode. Note that I added a simplification of the _M_get_Node_allocator(), static_cast is useless no ?

In this case, yes. In general a static_cast from one pointer type to
another pointer type cannot use user-defined conversion operators, so
is safer in some cases in generic code.

Ok to commit ?

OK, thanks.


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