File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1216,3 +1216,18 @@ private predicate constantTemplateLiteral(Expr e) {
12161216 or
12171217 constantTemplateLiteral ( e .( Cast ) .getExpr ( ) )
12181218}
1219+
1220+ /**
1221+ * A C++ three-way comparison operation, also known as the _spaceship
1222+ * operation_. This is specific to C++20 and later.
1223+ * ```
1224+ * auto c = (a <=> b);
1225+ * ```
1226+ */
1227+ class SpaceshipExpr extends BinaryOperation , @spaceshipexpr {
1228+ override string getCanonicalQLClass ( ) { result = "SpaceshipExpr" }
1229+
1230+ override int getPrecedence ( ) { result = 11 }
1231+
1232+ override string getOperator ( ) { result = "<=>" }
1233+ }
Original file line number Diff line number Diff line change @@ -1231,6 +1231,7 @@ funbind(
12311231 | @ltexpr
12321232 | @geexpr
12331233 | @leexpr
1234+ | @spaceshipexpr
12341235 ;
12351236
12361237@bin_bitwise_op_expr = @lshiftexpr
@@ -1636,6 +1637,7 @@ case @expr.kind of
16361637| 323 = @vec_fill
16371638| 324 = @builtinconvertvector
16381639| 325 = @builtincomplex
1640+ | 326 = @spaceshipexpr
16391641;
16401642
16411643new_allocated_type(
You can’t perform that action at this time.
0 commit comments