Page MenuHomePhabricator

[clang-tidy] diagnose possibiltiy to add 'noexcept' in modernize-use-noexcept
Needs ReviewPublic

Authored by JonasToth on Jan 23 2019, 10:53 AM.

Details

Summary

This patch utilizes the refactored ExceptionAnalyzer for
modernize-use-noexcept to diagnose possibilties to introduce noexcept
if there is no exception specification at all.
A follow-up patch will then implement the code-transformation if this patch
is useful.

Event Timeline

JonasToth created this revision.Jan 23 2019, 10:53 AM
  • rebase to current refactoring

Hmm, i think this diff is incorrect. Doesn't it also include the changes from D57100 ?

Hmm, i think this diff is incorrect. Doesn't it also include the changes from D57100 ?

yup, needs constant rebasing, i will do a final rebase once the other refactring is in.

  • rebase to latest patch
JonasToth updated this revision to Diff 184477.Jan 31 2019, 2:48 AM
  • Merge branch 'master' into feature-introduce-noexcept

Please add tests with lambdas,

test/clang-tidy/modernize-use-noexcept-new-noexcept.cpp
6–7

Unused functions.
I suspect if the first one called, we can't be optimistic, and say that noexcept can be added?

MyDeveloperDay added inline comments.
clang-tidy/modernize/UseNoexceptCheck.h
1

Nit: sorry OCD kicking in... space after tidy and before first -

Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2019, 2:17 AM

Great! However, I would rename the test files: modernize-use-noexcept-opt.cpp is inaccurate since there are multiple options, it could be e.g. modernize-use-noexcept-dont-use-noexcept-false.cpp. modernize-use-noexcept-new-noexcept.cpp is a bit misleading because of the new which is a valid C++ keyword. modernize-use-noexcept-add-missing-noexcept.cpp sounds better for me.

Ping! Any news regarding this patch?

Ping! Any news regarding this patch?

Its on the todolist, but i currently have many things to do in my real life, so no time for clang-tidy development :(