Open llvmbot opened 5 years ago
Have there been any updates on this? I'm having the exact same problem using the clangd extension for vscode. The version of the vscode clangd extension is: v0.1.15 I think the actual version of clangd that is used is: v14.0.3
No bug here, this someUnitInternalConst here is a GlobalConstantCase, StaticConstantCase is for static const variables in functions only.
Does this mean that clang cannot differentiate between translation unit scope (static uint8 someUnitSimpleList[] = {1, 2, 3};
) and global scope (uint8 someUnitSimpleGLobalList[] = {1, 2, 3};
) in C?
It looks like that, they both global variables, with different linkage but global.
ok thanks for the answer, to bad
Extended Description
using LLVM (http://llvm.org/): LLVM version 8.0.0 Optimized build. Default target: x86_64-pc-linux-gnu Host CPU: skylake
given a .c file with only the following content:
static uint32 const someUnitInternalConst = 4; static uint8 someUnitSimpleList[] = {1, 2, 3};
and the following configuration:
clang-tidy still throws the following errors (using [readability-identifier-naming,-warnings-as-errors])
error: invalid case style for global constant 'someUnitInternalConst' [readability-identifier-naming,-warnings-as-errors] static uint32 const someUnitInternalConst = 4; ^
~~~~SomeUnitInternalConsterror: invalid case style for global variable 'someUnitSimpleList' [readability-identifier-naming,-warnings-as-errors] static uint8 someUnitSimpleList[] = {1, 2, 3}; ^
~~~~~ SomeUnitSimpleListthus clang-tidy interprets the static (local) variables as global variables - which is wrong (?)