This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove workarounds for [[nodebug]] not working properly on typedefs in older Clangs
ClosedPublic

Authored by ldionne on Aug 31 2021, 7:33 AM.

Details

Summary

Clang used to support [[nodebug]] everywhere except on typedefs. Since
we don't support such old Clangs anymore, we can get rid of _LIBCPP_NODEBUG_TYPE
in favour of always using _LIBCPP_NODEBUG.

Diff Detail

Event Timeline

ldionne created this revision.Aug 31 2021, 7:33 AM
ldionne requested review of this revision.Aug 31 2021, 7:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 7:33 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone accepted this revision.Aug 31 2021, 9:06 AM

LGTM! The commit message should mention that (it looks like) old Clang didn't support the attribute on typedefs but did support it elsewhere. You're basically merging _LIBCPP_NODEBUG_TYPE into _LIBCPP_NODEBUG; i.e., we still have to support compilers that don't respect it, but those that do respect it, respect it on typedefs as well as on [other things].

libcxx/include/__functional/hash.h
853–856

Nit: two spaces before =, for no apparent reason

libcxx/include/__functional/weak_result_type.h
113–125

Nit: two spaces before _Rp, for no apparent reason

libcxx/include/__memory/unique_ptr.h
153–163

Nit: two spaces before = for no apparent reason

363

(et seq) Nit: two spaces... you know the drill.

libcxx/include/__tuple
331

two spaces

462

two spaces

libcxx/include/__utility/integer_sequence.h
46

two spaces (and line 57 also)

This revision is now accepted and ready to land.Aug 31 2021, 9:06 AM
ldionne updated this revision to Diff 369774.Aug 31 2021, 1:11 PM
ldionne marked 7 inline comments as done.
ldionne retitled this revision from [libc++] Remove workarounds for [[nodebug]] not being implemented in old Clangs to [libc++] Remove workarounds for [[nodebug]] not working properly on typedefs in older Clangs.
ldionne edited the summary of this revision. (Show Details)

Address review comments