This was probably added to support https://wg21.link/n3644 but there's
no reason not to initialize the pointer in all standard modes. This is
technically an extension since n3644 only required value-initialized
iterators to be comparable, but supporting this as an extension should
be uncontroversial since it avoids potential reads of uninitialized
memory in C++03/C++11 without doing any harm.
This patch adds a separate `extensions` directory, since there are quite
a few extensions in libc++ that aren't necessarily libc++-specific. For
example, the tests currently in `libcxx/test/libcxx/extensions` should
also pass with libstdc++, since they originally added the extension.
This also "documents" what users are allowed to rely on and what parts
are just libc++ tests to make sure our implementation is behaving as we
expect, which may be subject to change.
This patch also formats the tests and refactors `.fail.cpp` tests to
`.verify.cpp` tests.
Instead, define explicit specializations for the basic types listed in
the SGI documentation. This solves two problems:
1) Helps avoid silent ODR violations caused by the absence of a
user-supplied __gnu_cxx::hash specialization in cases where a std::hash
specialization exists (e.g. for std::string).
2) __gnu_cxx::hash semantics are slightly different to those of
std::hash (for example, the former may dereference a pointer argument)
so it is inappropriate for __gnu_cxx::hash to receive std::hash
specializations by default.
Differential Revision: http://llvm-reviews.chandlerc.com/D2747
llvm-svn: 203070