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

Letu Ren via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 13 03:06:06 PDT 2025


================
@@ -6749,6 +6749,55 @@ void SemaCodeCompletion::CodeCompleteInitializer(Scope *S, Decl *D) {
   CodeCompleteExpression(S, Data);
 }
 
+void SemaCodeCompletion::CodeCompleteIfConst(Scope *S,
+                                             bool AfterExclaim) const {
+  ResultBuilder Results(SemaRef, CodeCompleter->getAllocator(),
+                        CodeCompleter->getCodeCompletionTUInfo(),
+                        CodeCompletionContext::CCC_Other);
----------------
FantasqueX wrote:

![image](https://github.com/user-attachments/assets/4ba0669a-8495-46a0-9b48-9ff9bde4adca)
I think they are different. In `CodeCompleteAfterIf`, it's valid to provide a statement. While in the new added `CodeCompleteKeywordAfterIf ` only two keywords are appropriate.

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


More information about the cfe-commits mailing list