Page MenuHomePhabricator

Change the LLVM_ATTRIBUTE_DEPRECATED macro to use C++14 attribute.

Authored by csigg on Jan 7 2021, 12:59 AM.



C++14 attributes are superior because they can be applied to functions with inline definition and the syntax is cleaner.

I intend to convert all uses and then remove the macro.

One issue that might hold back switching uses to C++14 attributes is that
clang-format does not put long attributes on separate lines and formatted code will look like:

template <typename T>
[[deprecated("blah blah")]] void 
    foooooooooooooooooooooooooooo() {

Putting long attributes on a separate line would be prettier.

AttributeMacros probably won't help because it can't match the custom message.

Diff Detail

Event Timeline

csigg created this revision.Jan 7 2021, 12:59 AM
csigg requested review of this revision.Jan 7 2021, 12:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2021, 12:59 AM
rriddle accepted this revision.Jan 7 2021, 1:08 AM

LGTM from me, but can you send a post to llvm-dev to make sure there is general consensus?

This revision is now accepted and ready to land.Jan 7 2021, 1:08 AM
csigg edited the summary of this revision. (Show Details)Jan 8 2021, 2:47 AM
csigg edited the summary of this revision. (Show Details)
MaskRay accepted this revision.Jan 8 2021, 10:27 AM
MaskRay added a subscriber: MaskRay.