================
@@ -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);
+ CodeCompletionBuilder Builder(Results.getAllocator(),
+ Results.getCodeCompletionTUInfo());
+ Results.EnterNewScope();
+ if (getLangOpts().CPlusPlus17) {
+ if (!AfterExclaim) {
+ if (Results.includeCodePatterns()) {
+ Builder.AddTypedTextChunk("constexpr");
+ Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
+ Builder.AddChunk(CodeCompletionString::CK_LeftParen);
+ Builder.AddPlaceholderChunk("condition");
+ Builder.AddChunk(CodeCompletionString::CK_RightParen);
+ Builder.AddChunk(CodeCompletionString::CK_HorizontalSpace);
+ Builder.AddChunk(CodeCompletionString::CK_LeftBrace);
+ Builder.AddChunk(CodeCompletionString::CK_VerticalSpace);
+ Builder.AddPlaceholderChunk("statements");
+ Builder.AddChunk(CodeCompletionString::CK_VerticalSpace);
+ Builder.AddChunk(CodeCompletionString::CK_RightBrace);
+ Results.AddResult({Builder.TakeString()});
+ } else {
+ Results.AddResult({"constexpr"});
+ }
+ }
+ }
----------------
zyn0217 wrote:
They should be tested
https://github.com/llvm/llvm-project/pull/124315
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits