[clang] [C++26] [Contracts] Initial parser support (PR #221139)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 01:56:53 PDT 2026


================
@@ -6500,7 +6500,12 @@ class Sema final : public SemaBase {
 
   void SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind,
                            StringLiteral *DeletedMessage = nullptr);
-  void ActOnStartTrailingRequiresClause(Scope *S, Declarator &D);
+  void ActOnStartTrailingRequiresClauseOrContractSpecifier(Scope *S,
+                                                           Declarator &D);
+  /// Create a result variable for postconditions and make it visible in the
----------------
ChuanqiXu9 wrote:

e.g., `int fn() post(r: r > 0);` if we don't have the variable, we can't build AST for `r > 0`.

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


More information about the cfe-commits mailing list