I'm getting a few -Wundefined-inline warnings, and a -Wnon-modular-include-in-module too. Fix all of those.
Details
Details
- Reviewers
ldionne Mordante philnik - Group Reviewers
Restricted Project - Commits
- rG165841b681c1: [libc++][Modules] Fix a few module related warnings
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
An example warning I'm hitting locally:
In module 'std_private_algorithm_copy_n' imported from /.../usr/include/c++/v1/__string/char_traits.h:12: /.../usr/include/c++/v1/__algorithm/copy_n.h:57:1: warning: inline function 'std::copy_n<const char *, unsigned long, char *>' is not defined [-Wundefined-inline] copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) ^ /.../usr/include/c++/v1/__string/char_traits.h:242:14: note: used here std::copy_n(__s2, __n, __s1); ^
The only way I could find to fix that warning was to make the std_private_string_char_traits module export *.
Comment Actions
I can't reproduce the warning in check-cxx or run-buildbot generic-modules and I don't know why. It looks like the tests have -Werror=all, and just in case I tried adding -Werror=undefined-inline, but they still come up green. So I'm stumped why this seems to only reproduce when I install libc++ into my macOS SDK, but it seems like a serious problem with an easy fix that we'd better put into llvm 17.
Comment Actions
I think the changes are not too intrusive for LLVM-17 so I'm fine with backporting it.
LGTM!