[clang] 98f0b6f - [Clang][AST][NFC] Correct Comment in GenericSelectionExpr (#180850)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 20 06:48:43 PST 2026
Author: Will Hawkins
Date: 2026-02-20T06:48:39-08:00
New Revision: 98f0b6f4026fa578d269bc39d4d7bab5d81c2279
URL: https://github.com/llvm/llvm-project/commit/98f0b6f4026fa578d269bc39d4d7bab5d81c2279
DIFF: https://github.com/llvm/llvm-project/commit/98f0b6f4026fa578d269bc39d4d7bab5d81c2279.diff
LOG: [Clang][AST][NFC] Correct Comment in GenericSelectionExpr (#180850)
Correct a misleading comment about the number/type of trailing objects
in the GenericSelectionExpr.
Added:
Modified:
clang/include/clang/AST/Expr.h
Removed:
################################################################################
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 873ddb38e832a..37a1af584716a 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -6233,12 +6233,14 @@ class GenericSelectionExpr final
// GenericSelectionExpr is followed by several trailing objects.
// They are (in order):
//
- // * A single Stmt * for the controlling expression or a TypeSourceInfo * for
- // the controlling type, depending on the result of isTypePredicate() or
- // isExprPredicate().
- // * An array of getNumAssocs() Stmt * for the association expressions.
- // * An array of getNumAssocs() TypeSourceInfo *, one for each of the
- // association expressions.
+ // * An array of either
+ // - getNumAssocs() (if what controls the generic is not an expression), or
+ // - getNumAssocs() + 1 (if what controls the generic is an expression)
+ // Stmt * for the association expressions.
+ // * An array of
+ // - getNumAssocs() (if what controls the generic is not a type), or
+ // - getNumAssocs() + 1 (if what controls the generic is a type)
+ // TypeSourceInfo * for the association types.
unsigned numTrailingObjects(OverloadToken<Stmt *>) const {
// Add one to account for the controlling expression; the remainder
// are the associated expressions.
More information about the cfe-commits
mailing list