This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Use __builtin_FILE and __builtin_LINE in _LIBCPP_ASSERT
ClosedPublic

Authored by ldionne on Feb 6 2023, 4:13 PM.

Details

Summary

This avoids theoretical potential ODR violations since LINE and
FILE expand to different things depending on where they are.

Diff Detail

Event Timeline

ldionne created this revision.Feb 6 2023, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 4:13 PM
ldionne requested review of this revision.Feb 6 2023, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 4:13 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne updated this revision to Diff 495317.Feb 6 2023, 4:20 PM

Fix typo.

ldionne updated this revision to Diff 495363.Feb 6 2023, 8:10 PM

Rebase onto main

Mordante accepted this revision.Feb 7 2023, 12:48 AM
Mordante added a subscriber: Mordante.

Thanks for fixing this, LGTM!

libcxx/include/__assert
20

Can you look at this in a follow-up commit?

40–41

When you apply clang-format does it fix-up the location of \ in this file. (I wouldn't mind it in a follow-up or just prior to committing.)

This revision is now accepted and ready to land.Feb 7 2023, 12:48 AM
ldionne marked 2 inline comments as done.Feb 7 2023, 7:35 AM
ldionne added inline comments.
libcxx/include/__assert
20

Will do, thanks for the heads up.

40–41

I will fix prior to committing.

This revision was landed with ongoing or failed builds.Feb 7 2023, 7:36 AM
This revision was automatically updated to reflect the committed changes.
ldionne marked 2 inline comments as done.