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

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 30 10:55:27 PDT 2021


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 function. That list would either be maintained explicitly in Clang, or, preferably, we'd have an attribute that we can mark addressable functions with so that the compiler doesn't flag those specific functions.

I'm not sure whether that is actually a good approach, but I told @cjdb that from the library perspective, I was more comfortable with marking a few functions with that attribute than marking basically everything in the library with `[[noaddress]]`.


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