This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] prevent readability-identifier-naming from triggering on implicit VarDecls in coroutines
ClosedPublic

Authored by 0x1eaf on Dec 16 2020, 8:41 AM.

Details

Summary

We have an internal bug report about readability-identifier-naming
warnings on implicit __coro_gro and __promise variables
in coroutines.

Turns out they haven't been marked as implicit in SemaCoroutine.
This diff resolves that and adds a couroutine test for the check.

Tested with:

> cd build/Debug/bin
> ./llvm-lit -sv --param build_mode=Debug \
             ../../tools/clang/tools/extra/test \
             --filter readability-identifier-naming.cpp

Diff Detail

Event Timeline

0x1eaf created this revision.Dec 16 2020, 8:41 AM
0x1eaf requested review of this revision.Dec 16 2020, 8:41 AM
0x1eaf edited the summary of this revision. (Show Details)Dec 16 2020, 8:45 AM
aaron.ballman accepted this revision.Dec 16 2020, 10:08 AM

LGTM aside from some small nits, thank you for the fix! Do you need me to commit on your behalf? (If so, are you okay with using Emma Blink <emmablink@fb.com> for patch attribution?)

clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp
619
clang/lib/Sema/SemaCoroutine.cpp
547
1581
This revision is now accepted and ready to land.Dec 16 2020, 10:08 AM
0x1eaf updated this revision to Diff 312272.Dec 16 2020, 11:27 AM

Updated to address review comments.

Do you need me to commit on your behalf?

Yes, I don't have commit access. The attribution line looks good to me. Thank you! 🙂

0x1eaf marked 3 inline comments as done.Dec 16 2020, 11:36 AM

Do you need me to commit on your behalf?

Yes, I don't have commit access. The attribution line looks good to me. Thank you! 🙂

I've commit on your behalf in 7685d818ef329cd3f6ef121af1208be409eb59db, thank you for the patch!