[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-30 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D101598#2729865 , @ldionne wrote: > Just for posterity, what we discussed is that since there is a list of > addressable functions in the standard, we should explore adding a warning to > Clang that fires whenever somebody tak

[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-30 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. In D101598#2729865 , @ldionne wrote: > Just for posterity, what we discussed is that since there is a list of > addressable functions in the standard, we should explore adding a warning to > Clang that fires whenever somebody t

[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-30 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a comment. Just for posterity, what we discussed is that since there is a list of addressable functions in the standard, we should explore adding a warning to Clang that fires whenever somebody takes the address of a function in namespace `std`, except if it's an addressable funct

[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-30 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb abandoned this revision. cjdb added a comment. A different path forward was discussed with @ldionne and @zoecarver. Will experiment this other way. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101598/new/ https://reviews.llvm.org/D101598 __

[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-30 Thread Arthur O'Dwyer via Phabricator via cfe-commits
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@-1{{cannot take address of 'std::one_overload' because functions in namespace 'std' are not addressable}

[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-30 Thread Zoe Carver via Phabricator via cfe-commits
zoecarver added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:5972 + Although opt-in, the attribute poisons the entire overload set, meaning that only one overload + needs the attribute per set (although such usage is discouraged). Until there is confiden

[PATCH] D101598: [clang][Sema] adds `[[clang::no_address]]` attribute

2021-04-29 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added reviewers: rsmith, gbiv, aaron.ballman, manojgupta. Herald added a reviewer: george.burgess.iv. cjdb requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. [namespace.std]/p6 indicates that taking the address