Use = delete for member functions that are marked with // = delete;
Details
- Reviewers
ldionne • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rGfeb80aa96ba6: [libc++] `= delete` member functions with // = delete;
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM -- this one definitely has no ABI impact :)
I believe this might in some cases turn link errors into compile-time errors, but that's fine.
For some reason, I also have a feeling that this might make code that used to compile not compile anymore. From https://en.cppreference.com/w/cpp/language/function#Deleted_functions:
If the function is overloaded, overload resolution takes place first, and the program is only ill-formed if the deleted function was selected.
I believe I've seen some cases where deleted functions would cause hard errors to happen instead of SFINAE, because the deleted function would be viable, but when the compiler would select and try to instantiate it, it would say "you can't do that, the function is deleted". But I'm failing to reproduce that, so I guess it's not a real issue: https://godbolt.org/z/YjMK9G6qs
libcxx/include/__locale | ||
---|---|---|
211 | Interesting to see a copy assignment operator with return type of void. Is that actually intended? I suspect this meant to be id& operator=(const id&) = delete; surely, right? Ditto with seed_seq below in another file. |
libcxx/include/__locale | ||
---|---|---|
211 | The return type of a deleted overload is unobservable, so it doesn't really matter. But this is exactly implementing https://eel.is/c++draft/locale.id — <locale> is full of weird return types — so IMHO this diff is good as-is. | |
libcxx/include/__mutex_base | ||
145–146 | Could remove line 146 now. | |
libcxx/include/__random/random_device.h | ||
53 | http://eel.is/c++draft/rand.device specifies this return type as void also. Change it? | |
libcxx/include/__random/seed_seq.h | ||
66–68 | This unobservable void matches the specification in https://eel.is/c++draft/rand.util.seedseq and therefore LGTM. | |
libcxx/include/ios | ||
313–314 | Remove line 314? | |
libcxx/include/istream | ||
293–294 | Nit: Make these public (and move them down to line 302) to match https://eel.is/c++draft/istream.sentry | |
libcxx/include/mutex | ||
220 | Nit: Let's keep a blank line after 219, for consistency with the spec and with line 241. |
Interesting to see a copy assignment operator with return type of void. Is that actually intended? I suspect this meant to be id& operator=(const id&) = delete; surely, right?
Ditto with seed_seq below in another file.