Re: [PATCH] D24991: Inline hot functions in libcxx shared_ptr implementation.

2016-09-27 Thread Andrey Khalyavin via cfe-commits
halyavin added a subscriber: halyavin.


Comment at: libcxx/include/atomic_support.h:1
@@ +1,2 @@
+//===--===
+//

Non-standard include files in the main include directory must start with __ to 
avoid collisions with application headers.


Comment at: libcxx/include/atomic_support.h:1
@@ +1,2 @@
+//===--===
+//

halyavin wrote:
> Non-standard include files in the main include directory must start with __ 
> to avoid collisions with application headers.
Does anyone know why this header exists and atomic header can't be used 
instead? 


Repository:
  rL LLVM

https://reviews.llvm.org/D24991



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D23831: Fix gcc 4.9 -Wcast-qual warning.

2016-08-24 Thread Andrey Khalyavin via cfe-commits
halyavin created this revision.
halyavin added reviewers: cfe-commits, EricWF, mclow.lists.

C-style cast from const pointer to non-const pointer causes -Wcast-qual warning 
in gcc. Fix the problem by casting away const with const_cast. Additionally, 
replace C-style cast with appropriate C++-style cast. 

https://reviews.llvm.org/D23831

Files:
  include/type_traits

Index: include/type_traits
===
--- include/type_traits
+++ include/type_traits
@@ -443,7 +443,7 @@
 _Tp*
 addressof(_Tp& __x) _NOEXCEPT
 {
-return (_Tp*)&reinterpret_cast(__x);
+return reinterpret_cast<_Tp*>(const_cast(&reinterpret_cast(__x)));
 }
 
 #endif // __has_builtin(__builtin_addressof)


Index: include/type_traits
===
--- include/type_traits
+++ include/type_traits
@@ -443,7 +443,7 @@
 _Tp*
 addressof(_Tp& __x) _NOEXCEPT
 {
-return (_Tp*)&reinterpret_cast(__x);
+return reinterpret_cast<_Tp*>(const_cast(&reinterpret_cast(__x)));
 }
 
 #endif // __has_builtin(__builtin_addressof)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23831: [libcxx] Fix gcc 4.9 -Wcast-qual warning.

2016-08-27 Thread Andrey Khalyavin via cfe-commits
halyavin added a comment.

ping.


https://reviews.llvm.org/D23831



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23831: [libcxx] Fix gcc 4.9 -Wcast-qual warning.

2016-08-30 Thread Andrey Khalyavin via cfe-commits
halyavin added a comment.

Thank you for fixing most of warnings. Now it says "cc1plus: warning: 
unrecognized command line option "-Wno-c++14-compat"" though.


https://reviews.llvm.org/D23831



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23831: [libcxx] Fix gcc 4.9 -Wcast-qual warning.

2016-08-30 Thread Andrey Khalyavin via cfe-commits
halyavin added a comment.

We have libc++ in our source tree and compile it as part of our build process. 
All code in the source tree uses -Werror by default, so I am having compile 
errors on gcc 4.9.


https://reviews.llvm.org/D23831



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23831: [libcxx] Fix gcc 4.9 -Wcast-qual warning.

2016-08-30 Thread Andrey Khalyavin via cfe-commits
halyavin added a comment.

> ! In https://reviews.llvm.org/D23831#528668, @EricWF wrote:

> 

> Are you also compiling with `-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER`?


No. Libc++ buildbots doesn't set this option either and we do see warnings 
there. So the pragma doesn't help with compiling libc++ itself.


https://reviews.llvm.org/D23831



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23831: [libcxx] Fix gcc 4.9 -Wcast-qual warning.

2016-09-05 Thread Andrey Khalyavin via cfe-commits
halyavin added a comment.

False alarm. I figured out that only -Wattributes warnings ignore gcc 
system_header pragma. So this -Wcast-qual and other warnings doesn't block us.


https://reviews.llvm.org/D23831



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r295330 - math: correct the MSVCRT condition

2017-02-16 Thread Andrey Khalyavin via cfe-commits
What is _VC_CRT_NAJOR_VERSION? Is it misprint or a hack? Google gives zero
results.

-- Andrey Khalyavin

On Thu, Feb 16, 2017 at 6:47 PM, Saleem Abdulrasool via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: compnerd
> Date: Thu Feb 16 09:47:50 2017
> New Revision: 295330
>
> URL: http://llvm.org/viewvc/llvm-project?rev=295330&view=rev
> Log:
> math: correct the MSVCRT condition
>
> Fixes a number of tests in the testsuite on Windows.
>
> Modified:
> libcxx/trunk/include/cmath
> libcxx/trunk/include/math.h
>
> Modified: libcxx/trunk/include/cmath
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/
> cmath?rev=295330&r1=295329&r2=295330&view=diff
> 
> ==
> --- libcxx/trunk/include/cmath (original)
> +++ libcxx/trunk/include/cmath Thu Feb 16 09:47:50 2017
> @@ -398,7 +398,7 @@ using ::cbrtf;
>  using ::copysign;
>  using ::copysignf;
>
> -#if !defined(_LIBCPP_MSVCRT) || ((_VC_CRT_NAJOR_VERSION-0) >= 14)
> +#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
>  using ::erf;
>  using ::erff;
>  using ::erfc;
> @@ -435,7 +435,7 @@ using ::lrint;
>  using ::lrintf;
>  using ::lround;
>  using ::lroundf;
> -#endif // _LIBCPP_MSVCRT
> +#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
>
>  using ::nan;
>  using ::nanf;
>
> Modified: libcxx/trunk/include/math.h
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/
> math.h?rev=295330&r1=295329&r2=295330&view=diff
> 
> ==
> --- libcxx/trunk/include/math.h (original)
> +++ libcxx/trunk/include/math.h Thu Feb 16 09:47:50 2017
> @@ -1020,7 +1020,7 @@ copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NO
>  return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
>  }
>
> -#if !defined(_LIBCPP_MSVCRT) || ((_VC_CRT_MAJOR_VERSION-0) >= 14)
> +#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
>
>  // erf
>
> @@ -1404,7 +1404,7 @@ inline _LIBCPP_INLINE_VISIBILITY
>  typename std::enable_if::value, double>::type
>  trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);}
>
> -#endif // !defined(_LIBCPP_MSVCRT) || ((_VC_CRT_MAJOR_VERSION-0) >= 14)
> +#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_NAJOR_VERSION-0) < 14))
>
>  } // extern "C++"
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits