[PATCH] D96725: [clang-tidy] Fix modernize-use-using in extern C code
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 15 13:41:40 PST 2021
njames93 added inline comments.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-using.cpp:305
};
+
+extern "C" {
----------------
steveire wrote:
> Can you add tests for typedefs in other scopes like
>
> ```
>
> extern "C" {
> typedef int CType;
>
> struct CAnother {
> };
>
> typedef struct {
> int b;
> typedef struct CAnother AStruct;
> } CStruct;
>
> void foo()
> {
> typedef struct CAnother AStruct;
> }
> }
>
> ```
I'm not sure those tests add any value. For the struct, you can't have a typedef in a struct in c. The function typedef is valid in c, but I still can't see a reason to use extern C when defining a function in c++
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96725/new/
https://reviews.llvm.org/D96725
More information about the cfe-commits
mailing list