5chmidti wrote:

> Will this recommend constexpr for arrays? What about globals?

@shafik Yes, this does support globals and arrays. Check out [this part of 
tests](https://github.com/llvm/llvm-project/blob/5c78e2a5e2cbd8357eab9fb524dba2f398da8543/clang-tools-extra/test/clang-tidy/checkers/modernize/use-constexpr.cpp#L316-L334)
 for some globals and arrays. For arrays, I am checking if the array type 
itself supports being used in a constexpr context, and each element in the 
initializing expression is also checked. E.g., in these tests there are 
functions called in the initializer list that are not constexpr and therefore 
the array can not be constexpr.

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

Reply via email to