This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Remove obsolete checker google-runtime-references
ClosedPublic

Authored by baloghadamsoftware on Oct 5 2020, 6:26 AM.

Details

Summary

The rules which is the base of this checker is removed from the Google C++ Style Guide in May: Update C++ styleguide. Now this checker became obsolete.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2020, 6:26 AM
baloghadamsoftware requested review of this revision.Oct 5 2020, 6:26 AM

Does this check make sense in content of other style guides?

Does this check make sense in content of other style guides?

I'd +1 to moving it to readability.

Does this check make sense in content of other style guides?

I'd +1 to moving it to readability.

IMHO this check never made any sense. There was a Google-specific rule for this, that is why it was placed in google not in readability. Generally, forcing programmers not to use non-const reference parameters and force them the old C way (pointers) does not make any sense. I wonder why this rule was there in Google, but outside of it I never saw such a rule. I would surely not place such check into readability because following such rule reduces the readability instead of improving it. However, the main point is that even for Google there is no such rule anymore thus I see no point to keep this check.

gribozavr2 accepted this revision.Oct 5 2020, 8:51 AM

Google C++ style guide does not have this rule anymore. Thanks for the cleanup!

This revision is now accepted and ready to land.Oct 5 2020, 8:51 AM
aaron.ballman accepted this revision.Oct 5 2020, 12:53 PM

LGTM to remove rather than move into readability unless someone has a good argument as to why it belongs there. I don't think this pattern makes code more readable in general as it recommends using a more verbose syntax (pointers, which require dereferencing) over a safer, concise syntax (references, which carry semantic information about nullness).

One request though: can you add a release note about the removal with a brief explanation of why it was removed?

lebedev.ri added a subscriber: hans.Oct 7 2020, 5:09 AM

@hans it would be nice if this could make it into the release,
removing stuff is usually a pretty safe thing to do :)

hans added a comment.Oct 7 2020, 5:33 AM

@hans it would be nice if this could make it into the release,
removing stuff is usually a pretty safe thing to do :)

I think it's too late for this release, sorry. I also don't see any particular reason to rush this one.

clang-tools-extra/docs/ReleaseNotes.rst