[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute
Arthur O'Dwyer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 30 09:30:43 PDT 2021
Quuxplusone added inline comments.
================
Comment at: clang/test/SemaCXX/attr-no-address.cpp:47-48
+void address_test() {
+ void (*fp1)() = &std::one_overload;
+ // expected-error at -1{{cannot take address of 'std::one_overload' because functions in namespace 'std' are not addressable}}
+ void (*fp2)() = std::one_overload;
----------------
FWIW, I don't think this diagnostic provides any benefit to the user-programmer; it merely inconveniences them.
But it does add a lot of burden on the //libc++ developers//, who must now remember to add a new clang-specific attribute on every function they write.
So for me this is all cost and no benefit.
Am I correct that this attribute doesn't interfere with the user-programmer's writing `std::addressof(std::one_overload)`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101598/new/
https://reviews.llvm.org/D101598
More information about the cfe-commits
mailing list