[clang] Support `constexpr` for some `ASTNodeKind` member functions
authorEric Li <li.zhe.hua@gmail.com>
Wed, 12 Oct 2022 20:28:59 +0000 (16:28 -0400)
committerEric Li <li.zhe.hua@gmail.com>
Thu, 13 Oct 2022 17:00:48 +0000 (13:00 -0400)
commit576283c3a8ef5078b3ec12fa442c14f3a1b5fea2
tree3d4b87ae8cf31dc89c441859693a97f84fd0fddd
parent3ab947ede034b629765f26c7e2c9940fc7587d04
[clang] Support `constexpr` for some `ASTNodeKind` member functions

Add `constexpr` support for:

  * The `getFromNodeKind` factory function
  * `isSame`
  * `isNone`
  * `hasPointerIdentity`

This enables these functions to be used in SFINAE context for AST node
types.

Differential Revision: https://reviews.llvm.org/D135816
clang/include/clang/AST/ASTTypeTraits.h
clang/unittests/AST/ASTTypeTraitsTest.cpp