berkaysahiin wrote:

> Can we add test with multiple decls: `constexpr const int a = 1, b = 2` and 
> mixes like `constexpr const int a = 0, &b = a;`. For latter case we can't 
> remove const, but we can give only warning with no fixit.
> 
> Did you try to test the check against some codebases (like LLVM). If not, 
> please try to do so to find any FP/FN beforehand.
> 
> Otherwise LGTM.

Check currently fails at

```cpp
constexpr const int a = 0, &b = a;
```

where it matches `a` and suggests removal of `const`.

I have added `hasProblemSibling` to look for decls within the same statements 
and not offer fixit if any neighbor decl is typed either pointer or reference.

Let me know what you think. @vbvictor 

https://github.com/llvm/llvm-project/pull/189733
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to