[PATCH] D43209: Put type attributes after class keyword

Dimitry Andric via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 14:20:59 PST 2018


dim created this revision.
dim added reviewers: EricWF, mclow.lists.

Compiling `<functional>` in C++17 or higher mode results in:

  functional:2500:1: warning: attribute '__visibility__' is ignored, place it after "class" to apply attribute to type declaration [-Wignored-attributes]
  _LIBCPP_TYPE_VIS
  ^
  __config:701:46: note: expanded from macro '_LIBCPP_TYPE_VIS'
  #    define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
                                               ^
  1 warning generated.

Fix it by putting the attribute after the `class` keyword.


Repository:
  rCXX libc++

https://reviews.llvm.org/D43209

Files:
  include/functional


Index: include/functional
===================================================================
--- include/functional
+++ include/functional
@@ -2497,8 +2497,7 @@
 
 // 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, 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43209.133932.patch
Type: text/x-patch
Size: 450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180212/061e88f0/attachment.bin>


More information about the cfe-commits mailing list