File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -194,12 +194,14 @@ fun param_pos(n, pos: int = 0) =
194
194
195
195
# TODO: move this in LAL
196
196
fun is_predefined_op(op, follow_renamings=false) =
197
- |" Return true if ``op`` is a predefined operator
197
+ |" Return true if ``op`` is a predefined operator; ``op`` can be an Op or
198
+ |" a CallExpr.
198
199
{
199
- val ref = op.p_referenced_decl();
200
- val real_ref = if follow_renamings then ultimate_subprogram_alias(ref) else ref;
201
- # TODO: remove null check once all operators are synthesized (UB16-053)
202
- if real_ref then real_ref is SyntheticSubpDecl
200
+ val ref = if follow_renamings
201
+ then ultimate_subprogram_alias(op.p_referenced_decl())
202
+ else op.p_referenced_decl();
203
+ op is (Op | CallExpr(p_is_call(): true)) and
204
+ if ref then ref.p_is_predefined_operator()
203
205
}
204
206
205
207
fun is_standard_numeric(n) =
Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ Functions
145
145
146
146
.. function :: is_predefined_op(op, follow_renamings=false)
147
147
148
- Return true if ``op `` is a predefined operator
148
+ Return true if ``op `` is a predefined operator; ``op `` can be an Op or
149
+ a CallExpr.
149
150
150
151
.. function :: is_predefined_type(n)
151
152
You can’t perform that action at this time.
0 commit comments