[clang] [clang][CodeComplete] Add code completion for if constexpr and consteval (PR #124315)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 8 21:26:52 PST 2025


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

Thanks! I tried out the patch with clangd and it seems to be working pretty well.

A further enhancement that occurs to me is that we could offer these patterns slightly earlier, e.g. when you're at the beginning of an empty line and invoke code completion and then type `if` to filter the results, you see the `if (condition) {statements}` pattern as the first result -- we could have `if constexpr (condition) {statements}` as another result there already. But that can be a future enhancement for another time.

The implementation looks pretty good, just have some minor comments.

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


More information about the cfe-commits mailing list