Error 1 error C2681: 'add_rvalue_reference<_Tp*>::type' : invalid expression
type for dynamic_cast c:\libcxx\include\type_traits
This is one more step getting libcxx compile under Visual C++. The patch is
#if defined(_LIBCPP_MSVC) so will affect only this build.
When libcxx can be compiled, it will probably require the current version or
maybe even the next Update of Visual C++ 2013.
Patch by G M!
llvm-svn: 201844
rather than its own type for std::max_align_t. This is particularly
relevant as the types may not be ABI compatible despite users expecting
them to be.
llvm-svn: 201843
with Visual C++ 2013 by making libcxx definition text-identical to yvals.h.
Persumably this definition is for older Visual C++ versions.
In such cases it will still be defined so no functionality change.
Other platforms should not be affected as this is inside
#elif defined(_LIBCPP_MSVC)
Patch by G M!
llvm-svn: 201328
GCC will treat the default function template arguments as a
compilation error if C++0x is not enabled.
This commit workaround the compilation error by moving the
SFINAE check to function argument instead of the template
argument.
llvm-svn: 200523
The __sync_add_and_fetch() builtin parameter is volatile but clang has
'different' type checking and ends up accepting this code.
Undo the C++ cast from r198505 to get libc++/LLVM building with g++ while this
is investigated.
llvm-svn: 199494
for libcxx when compiled with Visual C++ on Win32 and Win64.
clang and gcc (MinGW) compilers provide these implementations themselves.
llvm-svn: 198481
We should check defined(__clang__) before the usage of the
clang diagnostic pragmas.
The [-Wswitch] warning in src/future.cpp should be ignored.
As the result, the equivalent GCC pragma is added.
llvm-svn: 197314
GCC does not support strong enum if -std=c++0x is not used.
Without the strong enum, we will see following error:
In file included from libcxx/include/ostream:131:0,
from libcxx/include/sstream:174,
from libcxx/include/complex:247,
from cpp03-headers.cpp:11:
libcxx/include/ios:419:68: error: 'io_errc' is not a class or namespace
libcxx/include/ios:420:66: error: 'io_errc' is not a class or namespace
To workaround this issue, this commit will define
_LIBCPP_HAS_NO_STRONG_ENUMS when we are compiling with
g++ without c++0x.
llvm-svn: 197313
type_traits:3280:31: error: expected primary-expression before 'decltype'
type_traits:3280:29: error: expected ';' at end of member declaration
memory:2415:49: error: function 'std::__1::default_delete<_Tp>::default_delete()'
defaulted on its first declaration must not have an exception-specification
memory:2435:49: error: function 'std::__1::default_delete<_Tp []>::default_delete()'
defaulted on its first declaration must not have an exception-specification
The attached patch defines _LIBCPP_HAS_NO_ADVANCED_SFINAE and
_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS for gcc version < 4.7, making
the library compile with gcc 4.6.4.
llvm-svn: 195431
functions in src/support/win32/locale_win32.cpp and locale_win32.h,
calling upon vsnprintf for which there is a MingW correct alternative.
Note! __USE_MINGW_ANSI_STDIO is not modified in this patch. In order to
use the __mingw version it must be defined before including the MingW
headers.
llvm-svn: 195044
easier to use freshly-built clang with freshly-built libc++.
Basically, this makes it possible to run clang with libc++ without
having to install it, even if you don't have any version of libc++
installed in /usr/
llvm-svn: 194825
trivial in C++03, thus making it trivial in both C++03 and C++11.
This patch allows one to opt-in/out of this decision with a macro. You can
choose to have the pair copy constructor always be trivial, or always be
non-trivial. The flag controlling this is now _LIBCPP_TRIVIAL_PAIR_COPY_CTOR.
The client can define this flag to 1, and the pair copy constructor will be
trivial (when possible of course), or to 0, and the pair copy constructor will
be nontrivial.
Default settings for this flag are set in <__config> (as usual). With this
commit the default is _LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1 for all platforms
except __APPLE__, which defaults to _LIBCPP_TRIVIAL_PAIR_COPY_CTOR=0.
llvm-svn: 194742
pair, and a couple of pair-like implementation detail types. The
C++98/03 and 11 standards all specify that the copy constructor of
pair<int, int> is trivial. However as libc++ tracked the draft C++11
standard over the years, this copy constructor became non-trivial, and
then just recently was corrected back to trivial for C++11.
Unfortunately (for libc++1) the Itanium ABI specifies different calling
conventions for trivial and non-trivial copy constructors. Therefore
currently the C++03 libc++ copy constructor for pair<int, int> is ABI
incompatible with the C++11 libc++ copy constructor for pair<int, int>.
This is Bad(tm). This patch corrects the situation by making this copy
constructor trivial in C++03 mode as well.
Just in case it is needed for an incomplete C++11 compiler, libc++
retains the ability to support pair with rvalue references, but without
defaulted special members. However the pair needs non-trivial special
members to implement this special case, (as it did when clang was in
this place a couple of years ago).
During this work a bug was also found and fixed in
is_trivially_constructible.
And there is a minor drive-by fix in <__config> regarding
__type_visibility__.
A test is updated to ensure that the copy constructor of pair<int, int>
is trivial in both C++03 and C++11. This test will necessarily fail for
a compiler that implements rvalue references but not defaulted special
members.
llvm-svn: 194536
http://lab.llvm.org:8013/builders/libcxx_clang-x86_64-darwin11-RA
lit.py: <string>:230: note: inferred use_system_lib as: False
lit.py: <string>:247: fatal: C++ ABI setting None unsupported for tests
cxx_abi is geting set to None, and the lit script errors out shortly after
that. This patch changes the default of cxx_abi from None to 'libcxxabi'.
This is likely not the right way to fix this problem. However it gets the
buildbot running again. Improvements to this fix are welcome.
llvm-svn: 192609
libsupc++ does not implement the dependent EH ABI and the
functionality it uses to implement std::exception_ptr (which it
declares as an alias of std::__exception_ptr::exception_ptr) is not
directly exported to clients. So we have little choice but to hijack
std::__exception_ptr::exception_ptr's (which fortunately has the
same layout as our std::exception_ptr) copy constructor, assignment
operator and destructor (which are part of its stable ABI), and its
rethrow_exception(std::__exception_ptr::exception_ptr) function.
Also, remove some out of date comments.
Differential Revision: http://llvm-reviews.chandlerc.com/D1826
llvm-svn: 192076
Linking against libstdc++, rather than libsupc++, is probably better
for people who need to link against clients of libstdc++. Because
libsupc++ is provided only as a static library, its globals are not
shared between the static library and the copy linked into libstdc++.
This has been found to cause at least one test failure.
This also removes a number of symbols which were multiply defined
between libstdc++ and libc++, only when linking with libstdc++.
Differential Revision: http://llvm-reviews.chandlerc.com/D1825
llvm-svn: 192075
The remaining multiple definitions were flushed out by attempting to
link libsupc++ and libc++ into the same executable with --whole-archive,
e.g.
clang++ -I../llvm/projects/libcxx/include -nodefaultlibs -Wl,--whole-archive lib/libc++.a /usr/lib/gcc/x86_64-linux-gnu/4.6/libsupc++.a -Wl,--no-whole-archive -lgcc -lgcc_s -lc -lpthread -lrt
(The same technique was used to flush out multiple definitions in
libstdc++.)
Differential Revision: http://llvm-reviews.chandlerc.com/D1824
llvm-svn: 192074
I've changed it so we don't set highest level warnings (all) for MSVC when building projects using cmake and instead leave the default. That's /W4 on my machine and seems to be ok.
With all warnings on for msvc, we see literally thousands of warnings. 99.99% aren't relevant and just obscure the ones that are.
I think the user can still override things if they want something different from the command line when using cmake.
llvm-svn: 192010
The issue this patch seeks to address is that MS's compiler (cl.exe) doesn't support the __attribute__((__weak__)) or __atribute__((__visibility__("default")) syntax; so a solution must be found where cl.exe doesn't see this syntax.
This patch seeks to solve this problem by changing code patterned like this:
__attribute__((__weak__, __visibility__("default")))
void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { /*snip*/; return p; }
to code like this:
_LIBCPP_WEAK
void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { return p; }
Howard: Thanks for all the comments regarding the default visibility
tag on the definition. I agree it isn't needed, and that there are lots
of other places where it is missing. That being said, I'm not wanting
to rock the boat on that issue right now. So I've added it back to the
definition via _LIBCPP_FUNC_VIS. A later pass dedicated just to this
issue can bring things in to a consistent state one way or the other.
Note that we do not want to have the exact same attributes on the
declaration and defintion in this case. The declaration should not be
marked weak, whereas the definition should (which is what G M's patch
did). I've fully tested on OS X to ensure that the resultant attribute
syntax actually works.
llvm-svn: 192007
The patch touches these files:
locale
array
deque
new
string
utility
vector
__bit_reference
__split_buffer
locale_win32.h
There is no intended functionality change and it is expected that reversing the position of the inline keyword with regard to the other keywords does not change the meaning of anything, least not for apple/Linux etc.
It is intended to make libcxx more consistent with itself and to prevent the 1000 or so
"inline.cpp(3) : warning C4141: 'inline' : used more than once" warnings that MS's cl.exe compiler emits without this patch, i.e. if inline is not the first keyword before a function name etc.
Prefer "inline [other inline related keyword]" over "[other related keyword] inline".
After this patch, libcxx should be consistent to this pattern.
llvm-svn: 191987
libcxx doesn't build with -Werror because of #warnings in its source
code. But when libcxx is built as an external LLVM project, it inherits
LLVM build flags, breaking the build if LLVM_ENABLE_WERROR is enabled.
llvm-svn: 191814