Open Quuxplusone opened 8 years ago
I think will be good idea to extend scope of the check to also move static declarations in C++ source files into anonymous namespaces.
First part is implemented in r265384.
(In reply to comment #1)
> I think will be good idea to extend scope of the check to also move static
> declarations in C++ source files into anonymous namespaces.
LLVM's coding standards say to do the opposite.
http://llvm.org/docs/CodingStandards.html#anonymous-namespaces
"make anonymous namespaces as small as possible, and only use them for class
declarations."
(In reply to comment #3)
> (In reply to comment #1)
> > I think will be good idea to extend scope of the check to also move static
> > declarations in C++ source files into anonymous namespaces.
>
> LLVM's coding standards say to do the opposite.
>
> http://llvm.org/docs/CodingStandards.html#anonymous-namespaces
>
> "make anonymous namespaces as small as possible, and only use them for class
> declarations."
See also bug 27267.
I think will be good idea to have C++ check which fill detect and fix static declarations in anonymous namespaces.