[libcxx-commits] [PATCH] D58473: Fix a few swapped _LIBCPP_TEMPLATE_VIS attributes

Dimitry Andric via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 20 12:48:37 PST 2019


dim created this revision.
dim added reviewers: EricWF, mclow.lists, ldionne.
Herald added a subscriber: christof.

Clang 8 warns about `<__node_handle>`'s `__insert_return_type` visibility
attribute:

  In file included from include/map:480:
  include/__node_handle:196:1: warning: attribute '__type_visibility__' is ignored, place it after "struct" to apply attribute to type declaration [-Wignored-attributes]
  _LIBCPP_TEMPLATE_VIS
  ^
  include/__config:719:52: note: expanded from macro '_LIBCPP_TEMPLATE_VIS'
  #      define _LIBCPP_TEMPLATE_VIS __attribute__ ((__type_visibility__("default")))

Place the attribute after the struct to avoid the warning.

Apply similar fixes to `<experimental/functional>`.


Repository:
  rCXX libc++

https://reviews.llvm.org/D58473

Files:
  include/__node_handle
  include/experimental/functional


Index: include/experimental/functional
===================================================================
--- include/experimental/functional
+++ include/experimental/functional
@@ -109,8 +109,7 @@
 #if _LIBCPP_STD_VER > 11
 // default searcher
 template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-_LIBCPP_TYPE_VIS
-class default_searcher {
+class _LIBCPP_TYPE_VIS default_searcher {
 public:
     _LIBCPP_INLINE_VISIBILITY
     default_searcher(_ForwardIterator __f, _ForwardIterator __l, 
@@ -208,8 +207,7 @@
 template <class _RandomAccessIterator1, 
           class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>, 
           class _BinaryPredicate = equal_to<>>
-_LIBCPP_TYPE_VIS
-class boyer_moore_searcher {
+class _LIBCPP_TYPE_VIS boyer_moore_searcher {
 private:
     typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
     typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type      value_type;
@@ -360,8 +358,7 @@
 template <class _RandomAccessIterator1, 
           class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>, 
           class _BinaryPredicate = equal_to<>>
-_LIBCPP_TYPE_VIS
-class boyer_moore_horspool_searcher {
+class _LIBCPP_TYPE_VIS boyer_moore_horspool_searcher {
 private:
     typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type;
     typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type      value_type;
Index: include/__node_handle
===================================================================
--- include/__node_handle
+++ include/__node_handle
@@ -193,8 +193,7 @@
     __basic_node_handle< _NodeType, _Alloc, __map_node_handle_specifics>;
 
 template <class _Iterator, class _NodeType>
-_LIBCPP_TEMPLATE_VIS
-struct __insert_return_type
+struct _LIBCPP_TEMPLATE_VIS __insert_return_type
 {
     _Iterator position;
     bool inserted;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58473.187653.patch
Type: text/x-patch
Size: 1981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190220/80b59229/attachment.bin>


More information about the libcxx-commits mailing list