[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D72378#1840461 , @lebedev.ri wrote: > In D72378#1840455 , @aaron.ballman > wrote: > > > In D72378#1840353 , @lebedev.ri > > wrote: > > > >

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In D72378#1840455 , @aaron.ballman wrote: > In D72378#1840353 , @lebedev.ri > wrote: > > > So, i'm seeing an issue here: > > https://godbolt.org/z/KM2qLa > > > > I can't `NOLINT` it, b

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D72378#1840353 , @lebedev.ri wrote: > So, i'm seeing an issue here: > https://godbolt.org/z/KM2qLa > > I can't `NOLINT` it, because it is defined not in the source file, but in > compile line. > And i can't whitelist it

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. So, i'm seeing an issue here: https://godbolt.org/z/KM2qLa I can't `NOLINT` it, because it is defined not in the source file, but in compile line. And i can't whitelist it since there is no whitelist.. PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

Re: [PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-17 Thread Aaron Ballman via cfe-commits
On Fri, Jan 17, 2020 at 9:49 AM Nico Weber via Phabricator wrote: > > thakis added a comment. > > Looks like this isn't building on Windows: > http://45.33.8.238/win/6039/step_4.txt Yup, I'm already investigating a fix. ~Aaron > > > Repository: > rG LLVM Github Monorepo > > CHANGES SINCE LAS

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-17 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. Looks like this isn't building on Windows: http://45.33.8.238/win/6039/step_4.txt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://reviews.llvm.org/D72378 ___ c

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-17 Thread Nico Weber via Phabricator via cfe-commits
thakis added a comment. cl.exe prints a different error: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/13716/steps/stage%201%20build/logs/stdio Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://reviews.llvm.org/D72

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. Thank you for the new checker -- I've committed on your behalf in 42a0355816d3bc125d59cbd07052c8886e78ca86 Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-16 Thread Logan Smith via Phabricator via cfe-commits
logan-5 updated this revision to Diff 238640. logan-5 added a comment. Should be good now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://reviews.llvm.org/D72378 Files: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.c

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D72378#1824586 , @logan-5 wrote: > Great! In that case, I'll need help committing this, as well as the thing it > depends on, https://reviews.llvm.org/D72284 (which has also been LGTM'd). Great, can you rebase this patc

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-16 Thread Logan Smith via Phabricator via cfe-commits
logan-5 added a comment. Great! In that case, I'll need help committing this, as well as the thing it depends on, https://reviews.llvm.org/D72284 (which has also been LGTM'd). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://review

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp:27-34 +static const char NonReservedMessage[] = +"declaration uses iden

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-14 Thread Logan Smith via Phabricator via cfe-commits
logan-5 added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/ReservedIdentifierCheck.cpp:27-34 +static const char NonReservedMessage[] = +"declaration uses identifier '%0', which is not a reserved " +"identifier"; +static const char GlobalUnderscoreMe

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-14 Thread Logan Smith via Phabricator via cfe-commits
logan-5 updated this revision to Diff 238064. logan-5 marked 6 inline comments as done. logan-5 added a comment. Renamed check option from "Whitelist" to "AllowedIdentifiers". Added note about missing checks in documentation. Changed to use a %select for diagnostic text. Some nits. The check do

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think this patch is getting pretty close to finished -- have you tried running it over a large corpus of code to see if it spots reserved identifiers (or unreserved ones)? If not, I would recommend running it over LLVM + clang + clang-tools-extra to see how it o

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-11 Thread Mark de Wever via Phabricator via cfe-commits
Mordante added a comment. Adding `Depends on D72284` would add the patches to the stack. I like the patch! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://reviews.llvm.org/D72378 ___

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-10 Thread Logan Smith via Phabricator via cfe-commits
logan-5 updated this revision to Diff 237433. logan-5 marked 4 inline comments as done. logan-5 added a comment. Added a TODO comment for catching more reserved names. Added links in documentation to CERT guidelines covered by the check. Pulled strings into named constants and made that logic ea

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D72378#1812620 , @logan-5 wrote: > In D72378#1810763 , @aaron.ballman > wrote: > > > This check is missing a whole lot of reserved identifiers. For instance, in > > C++ it is miss

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-10 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please rebase from trunk. I sorted Clang-tidy entries in Release Notes and aliases have own subsubsection. Please keep alphabetical order there. Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-dcl51-cpp.rst:6 +cert-dcl51-cpp +=

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-09 Thread Logan Smith via Phabricator via cfe-commits
logan-5 updated this revision to Diff 237244. logan-5 marked 8 inline comments as done. logan-5 added a comment. Addressed nits. Added CERT aliases. Adjusted the check to work for both C and C++, including where they differ. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-09 Thread Logan Smith via Phabricator via cfe-commits
logan-5 marked 2 inline comments as done. logan-5 added a comment. In D72378#1810763 , @aaron.ballman wrote: > This check is missing a whole lot of reserved identifiers. For instance, in > C++ it is missing everything from http://eel.is/c++draft/zombie.n

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. This check is missing a whole lot of reserved identifiers. For instance, in C++ it is missing everything from http://eel.is/c++draft/zombie.names and for C it is missing everything from future library directions. Are you intending to cover those cases as well?

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-08 Thread Logan Smith via Phabricator via cfe-commits
logan-5 updated this revision to Diff 236891. logan-5 marked 3 inline comments as done. logan-5 added a comment. Added tests for template parameters. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://reviews.llvm.org/D72378 Files:

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst:34 + If non-zero, inverts the check, i.e. flags names that are not reserved. + Default is `0`. + JonasToth wrote: > i think you need

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst:34 + If non-zero, inverts the check, i.e. flags names that are not reserved. + Default is `0`. + i think you need double-tick here. The hi

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-07 Thread Logan Smith via Phabricator via cfe-commits
logan-5 updated this revision to Diff 236754. logan-5 marked an inline comment as done. logan-5 added a comment. Addressed some nits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72378/new/ https://reviews.llvm.org/D72378 Files: clang-tools-ext

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-07 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:100 + + Checks for usages of identifiers reserved for use by the C++ implementation. + The C++ standard reserves the following names for such use: One sentence is enough,

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-07 Thread Logan Smith via Phabricator via cfe-commits
logan-5 created this revision. logan-5 added reviewers: JonasToth, alexfh, aaron.ballman. logan-5 added a project: clang-tools-extra. Herald added subscribers: cfe-commits, xazax.hun, mgorny. Herald added a project: clang. This patch adds `bugprone-reserved-identifier`, which flags uses of `__name