<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Some type_traits return incorrect values when used by gcc"
href="https://llvm.org/bugs/show_bug.cgi?id=27538">27538</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Some type_traits return incorrect values when used by gcc
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tomasz.sniatowski+llvm@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Using G++ 4.8/4.9 with libc++ as provided by libc++-helpers on Ubuntu 14.04, or
as available in Android NDK, some type traits don't work as expected:
* std::is_convertible<char[], std::string>::value is false
* with struct A { int a; }; std::is_trivially_copyable<A>::value is false
For example:
$ cat trivially_copyable.cpp
#include <type_traits>
struct A { int a; };
static_assert(std::is_trivially_copyable<A>::value, "A");
$ g++-libc++ trivially_copyable.cpp
trivially_copyable.cpp:3:1: error: static assertion failed: A
static_assert(std::is_trivially_copyable<A>::value, "A");
^
The above works with the same libc++ when compiled by clang++.
This happens for me with the libc++ provided in android-ndk-r11c which is noted
as based on "svn: <a href="http://llvm.org/svn/llvm-project/libcxx/trunk">http://llvm.org/svn/llvm-project/libcxx/trunk</a> revision:
201101", also happens on ubuntu with libc++-helpers:all/trusty 1.0~svn199600-1
See <a href="https://code.google.com/p/android/issues/detail?id=208352">https://code.google.com/p/android/issues/detail?id=208352</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>