[llvm] SmallVector: add missing constexpr annotations (NFC) (PR #98296)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 07:28:42 PDT 2024


https://github.com/kuhar requested changes to this pull request.

> For instance, a constexpr computation involving SmallVector::size() cannot be marked constexpr. Not marking it as constexpr will not give us an inlining-guarantee, for instance. Another example of a serious issue is that we can't use a compile-time assertion on a non-constexpr expression: we'd have to use a runtime assertion instead.

Isn't a constexpr constructor a prerequisite for using these in the constexpr context anyway?

https://github.com/llvm/llvm-project/pull/98296


More information about the llvm-commits mailing list