Bug 192139 - typo in libc++ type_traits (affects C++1y only)
Summary: typo in libc++ type_traits (affects C++1y only)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-26 17:39 UTC by rcarter
Modified: 2014-09-05 14:49 UTC (History)
1 user (show)

See Also:


Attachments
patch file (442 bytes, patch)
2014-07-26 17:39 UTC, rcarter
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rcarter 2014-07-26 17:39:11 UTC
Created attachment 145002 [details]
patch file

$ echo '#include <type_traits>' > test.cpp
$ /usr/bin/c++ -std=c++1y -c test.cpp

In file included from test.cpp:1:
/usr/include/c++/v1/type_traits:304:14: error: no template named
      '____is_nullptr_t'; did you mean '__is_nullptr_t'?
    : public ____is_nullptr_t<typename remove_cv<_Tp>::type> {};
             ^
/usr/include/c++/v1/type_traits:299:51: note: '__is_nullptr_t' declared here
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __is_nullptr_t
                                                  ^
1 error generated.

Apply patch, cp type_traits to /usr/include/c++/v1/

$ /usr/bin/c++ -std=c++1y -c test.cpp
$ 

patch:

--- contrib/libc++/include/type_traits.orig     2014-07-26 10:30:43.939891390 -0700
+++ contrib/libc++/include/type_traits  2014-07-26 10:31:56.207884662 -0700
@@ -301,7 +301,7 @@
 
 #if _LIBCPP_STD_VER > 11
 template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_null_pointer
-    : public ____is_nullptr_t<typename remove_cv<_Tp>::type> {};
+    : public __is_nullptr_t<typename remove_cv<_Tp>::type> {};
 #endif
 
 // is_integral
Comment 1 rcarter 2014-07-28 00:18:24 UTC
Current head is:

http://llvm.org/svn/llvm-project/libcxx/trunk/include/type_traits

and evidently the fix is correct.
Comment 2 Pedro F. Giffuni freebsd_committer freebsd_triage 2014-08-23 05:05:25 UTC
Task for maintainer.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-08-23 15:55:05 UTC
A commit references this bug:

Author: dim
Date: Sat Aug 23 15:54:23 UTC 2014
New revision: 270416
URL: http://svnweb.freebsd.org/changeset/base/270416

Log:
  In r260015, I renamed several identifiers to avoid -Wsystem-header
  warnings.  In r261283, I imported libc++ 3.4 release, but this contained
  one identifier that had not been renamed yet, leading to a compilation
  error when using -std=c++1y.  Fix the compilation error by correctly
  renaming the identifier.

  Reported by:	rcarter@pinyon.org
  PR:		base/192139
  MFC after:	3 days

Changes:
  head/contrib/libc++/include/type_traits
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-08-26 06:32:17 UTC
A commit references this bug:

Author: dim
Date: Tue Aug 26 06:31:53 UTC 2014
New revision: 270646
URL: http://svnweb.freebsd.org/changeset/base/270646

Log:
  MFC r270416:

  In r260015, I renamed several identifiers to avoid -Wsystem-header
  warnings.  In r261283, I imported libc++ 3.4 release, but this contained
  one identifier that had not been renamed yet, leading to a compilation
  error when using -std=c++1y.  Fix the compilation error by correctly
  renaming the identifier.

  Reported by:	rcarter@pinyon.org
  PR:		base/192139

Changes:
_U  stable/10/
  stable/10/contrib/libc++/include/type_traits
_U  stable/9/contrib/libc++/
  stable/9/contrib/libc++/include/type_traits
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2014-08-26 06:36:54 UTC
Fixed in head, stable/10 and stable/9.