[clang] [Clang][Sema] Warn when 'exclude_from_explicit_instantiation' attribute is used on local classes and members thereof (PR #88777)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 18 22:26:11 PDT 2024


mikaelholmen wrote:

I noticed that when compiling libcxx with this patch there are zillions of warnings like
```
[1950/2073] Building CXX object libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o
In file included from /repo/libcxx/src/filesystem/operations.cpp:16:
In file included from /repo/llvm/build-all-builtins/include/c++/v1/iterator:687:
In file included from /repo/llvm/build-all-builtins/include/c++/v1/__iterator/common_iterator.h:31:
/repo/llvm/build-all-builtins/include/c++/v1/variant:912:9: warning: '__exclude_from_explicit_instantiation__' attribute ignored on local class member [-Wignored-attributes]
  912 |         _LIBCPP_HIDE_FROM_ABI void operator()(true_type) const { __this->__emplace<_Ip>(std::forward<_Arg>(__arg)); }
      |         ^
/repo/llvm/build-all-builtins/include/c++/v1/__config:792:22: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
  792 |       _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION                                                       \
      |                      ^
/repo/llvm/build-all-builtins/include/c++/v1/__config:695:72: note: expanded from macro '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION'
  695 | #    define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((__exclude_from_explicit_instantiation__))
      |                                                                        ^
```
Is there any plan to clean this out?

https://github.com/llvm/llvm-project/pull/88777


More information about the cfe-commits mailing list