Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

Compilation errors on standard header files in libc++

$
0
0

MacOS 10.10.3, Xcode 6.3.2, Intel Composer 2015 sp 3. Compiling against 10.10 (or 10.9) SDK, including any standard header (such as <algorithm>) that eventually includes cpp_type_traits.h or allocator.h, I get the errors below if the C++ standard library is set to libc++. The errors go away if I use libstdc++:

cpp_type_traits (from OS X 10.10/usr/include/c++/4.2.1/bits/cpp_type_traits.h)

 

line 379:  // For the immediate use, the following is a good approximation.

template<typename _Tp>

struct __is_pod     <— Error: expected an identifier

{

enum

{

__value = (sizeof(__detail::__test_type<_Tp>(0))

!= sizeof(__detail::__one))

};

};

 

//

// A stripped-down version of std::tr1::is_empty

//

template<typename _Tp>

struct __is_empty   <— Error: expected an identifier

{

private:

template<typename>

struct __first { };

template<typename _Up>

struct __second

: public _Up { };

 

public:

enum

{

__value = sizeof(__first<_Tp>) == sizeof(__second<_Tp>)

};

};

 

 

allocator.h

 

  // To implement Option 3 of DR 431.

template<typename _Alloc, bool = std::__is_empty<_Alloc>::__value>  <— Error : expected an identifier; the global scope has no “__value”; expected a “,” or “>”

 

struct __alloc_swap

{ static void _S_do_it(_Alloc&, _Alloc&) { } };

 

template<typename _Alloc>

struct __alloc_swap<_Alloc, false>  <— Error: a template argument list is not allowed in a declaration of a primary template

{

static void

_S_do_it(_Alloc& __one, _Alloc& __two)

{

// Precondition: swappable allocators.

if (__one != __two)

swap(__one, __two);

}

};

 


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>