[PATCH] D86671: [clang-tidy] Add new case type to check variables with Hungarian notation
Douglas Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun May 2 00:02:37 PDT 2021
dougpuob added a comment.
Hi @njames93,
That's ok. You have helped me a lots. Thank you.
================
Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:450
+ if (!isHungarianNotationSupportedStyle(I) && HPTOpt.hasValue())
+ Options.diagnoseInvalidConfigOption(StyleString);
+ StyleString.resize(StyleSize);
----------------
njames93 wrote:
>
To use configurationDiag() function in getFileStyleFromOptions(), seems it needs to pass a ClangTidyContext object to getFileStyleFromOptions(). How about changing like the following?
```
getFileStyleFromOptions(const ClangTidyCheck::OptionsView &Options,
ClangTidyContext &Context) {
...
if (!isHungarianNotationSupportedStyle(I) && HPTOpt.hasValue())
Context.configurationDiag("invalid identifier naming option '%0'")
<< StyleString;
...
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86671/new/
https://reviews.llvm.org/D86671
More information about the cfe-commits
mailing list