This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Replace deprecated std::ios_base aliases
ClosedPublic

Authored by andobence on Aug 27 2018, 4:56 PM.

Details

Summary

This check warns the uses of the deprecated member types of std::ios_base
and replaces those that have a non-deprecated equivalent.

Diff Detail

Event Timeline

andobence created this revision.Aug 27 2018, 4:56 PM
andobence retitled this revision from Replace deprecated std::ios_base aliases to [clang-tidy] Replace deprecated std::ios_base aliases.Aug 27 2018, 5:05 PM

Hi andobence,

thank you for the contribution. The check looks very good!
Please add it to the release notes and synchronize the first line of the doc with the short sentence in the release notes describing what this check does.

clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.h
20

I I think you can write non-deprecated without the whitespace.

test/clang-tidy/modernize-deprecated-ios-base-aliases.cpp
14

That format looks weird. Could you please run clang-format over the test as well?

JonasToth added inline comments.Aug 28 2018, 1:01 AM
clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp
34

Which standard supplies the replacement functionality? e.g. for C++98 the warning is probably not relevant because there is no way to replace the deprecated types, but for C++17 it is possible.

andobence updated this revision to Diff 165453.Sep 14 2018, 3:15 AM

Fixed everything mentioned in comments.

andobence marked 2 inline comments as done.Sep 14 2018, 3:35 AM
andobence added inline comments.
clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp
34

C++98 already has them, these types has been deprecated since draft N0785 from 1995.

LG from my side, please rebase that patch on top of master. Currently the Release Notes would conflict (and please sort the release note alphabetically).

If the other reviewers do not say anything within a reasonable time it can be committed. Do you have commit rights?

And i forgot: Could you please run this over a real code base, if you know one that actually uses these types?
I assume not so many code bases actually use these.

alexfh accepted this revision.Oct 4 2018, 8:02 AM

LG once other comments are addressed.

This revision is now accepted and ready to land.Oct 4 2018, 8:02 AM
JonasToth added a comment.EditedOct 4 2018, 8:53 AM

from my side is nothing outstanding, do you need someone to commit on your behalf?

andobence updated this revision to Diff 168452.Oct 5 2018, 3:56 AM

Rebased on top of master.
I don't have commit rights.

JonasToth closed this revision.Oct 5 2018, 6:43 AM

Commited in https://reviews.llvm.org/rL343848.
Thank you for the patch!