This patch makes the -Wunused-variable warning behaviour more consistent: Now clang won't warn on variables with constant array types where it doesn't warn on variables with scalar types.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
There's no reason for this to only consider constant-sized arrays, and you should use getBaseElementTypeUnsafe() so you look through nested array types. That method is a no-op on non-array types, so you can just call it unconditionally here.
Comment Actions
Please add a line testing the nested-array case to warn-unused-variables.cpp, but with that, LGTM.