llvm / llvm/llvm-project

Question: Can we enable `misc-include-cleaner` of Objective-C++?

Open
#181,209 12 comments 0 reactions 0 assignees View on GitHub
clang-tidy question
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Hi,

I am not sure there is any technical difficulties around the check for Objective-C++, but it seems to be disabled in in the check: https://github.com/llvm/llvm-project/blob/f724d867e3a397f0ec00a30d74171cdb74f863f9/clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.cpp#L87-L90

And it seems Objective-C++ is being resolved as ObjC in LangOptions.cpp: https://github.com/llvm/llvm-project/blob/a289341dedf4d73955faefbb0b3c13881e13dd06/clang/lib/Basic/LangOptions.cpp#L103-L107

So, I am not sure whether we should:
- Enable the check for all of the C-like languages: Objective-C, Objective-C++, C++, and C. Or maybe there are some specific difficulties around that.
- Should we extend the options to specify Objective-C++ explicitly and maybe fix the check?
- Maybe add an option into the check which would list the set of languages which are supported by the check?

We have some reasonable amount of the code which compiles as Objective-C++ because we use Cocoa headers and it's a substantial work to completely migrate on C++ without those headers. But, that's also a valid option for us.

Please, let me know what you think and thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.