This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix range for forward-declared enums
ClosedPublic

Authored by kadircet on Oct 6 2021, 1:01 PM.

Details

Summary

This used to span just the [[enum foo]] : bar; in the absence of a
body. This patch expands the range to cover the base specifier, so that the
various consumers can detect the full range of the decl.

Diff Detail

Event Timeline

kadircet requested review of this revision.Oct 6 2021, 1:01 PM
kadircet created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2021, 1:01 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sammccall accepted this revision.Oct 8 2021, 5:57 AM
sammccall added inline comments.
clang/lib/AST/Decl.cpp
4509

Both these comments echo the code a bit.

Maybe the only thing I'd mention is "TagDecl doesn't know about the enum base"

4510

Nit: you don't need the TagDecl:: qualifier

Maybe move this condition inside the getITSI if, to make it clearer this is an exception/condition/interaction with that case.

This revision is now accepted and ready to land.Oct 8 2021, 5:57 AM
nridge added a subscriber: nridge.Oct 11 2021, 7:26 PM
This revision was automatically updated to reflect the committed changes.
kadircet marked 2 inline comments as done.