[NFC] let FunctionDecl::isReservedGlobalPlacementOperator return false when the funct...
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 4 Jan 2023 10:57:33 +0000 (18:57 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Wed, 4 Jan 2023 10:57:36 +0000 (18:57 +0800)
commit8a06b2362a4b4da835d7d6041d1c0d706b5281b7
treeeff642fe217c3c72425bb4699cecd435fd0a1382
parent8ec0a369675b8406460fac1f94a6f2d84b7c0bb4
[NFC] let FunctionDecl::isReservedGlobalPlacementOperator return false when the function decl is not allocation functions

Currently `FunctionDecl::isReservedGlobalPlacementOperator` will crash
if the function is not an allocation/deallocation function, which is
surprising. Also, its semantics is not consistent with
isReplaceableGlobalAllocationFunction, which will return false if the
function is not an allocation/deallocation function.

This patch make FunctionDecl::isReservedGlobalPlacementOperator not
crash if the function is not an allocation/deallocation function, which
is consistent with isReplaceableGlobalAllocationFunction too.
clang/lib/AST/Decl.cpp