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) =
194194
195195# TODO: move this in LAL
196196fun 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.
198199{
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()
203205}
204206
205207fun is_standard_numeric(n) =
Original file line number Diff line number Diff line change @@ -145,7 +145,8 @@ Functions
145145
146146.. function :: is_predefined_op(op, follow_renamings=false)
147147
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.
149150
150151.. function :: is_predefined_type(n)
151152
You can’t perform that action at this time.
0 commit comments