[clang] [libclang] Add clang_CXXMethod_getQualifiers, clang_Cursor_isConstexpr, and clang_CXXMethod_isExplicitObjectMemberFunction (PR #183305)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 29 07:02:49 PDT 2026


================
@@ -3351,6 +3351,14 @@ CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin(CXCursor C);
  */
 CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined(CXCursor C);
 
+/**
+ * Determine whether a cursor refers to a constexpr declaration.
+ *
+ * If the cursor does not refer to a constexpr variable or function
+ * declaration, 0 is returned.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isConstexpr(CXCursor C);
----------------
AaronBallman wrote:

Vlad and I talked about whether we should also generalize this interface like we recommended for qualifiers (there are other declaration specifiers, like consteval, constinit, etc) but we did not think this should be generalized (at least at this time, it requires more design work to try to generalize so best kept out of this PR). Declaration specifiers really are a case-by-case basis (e.g., friend is a declaration specifier but that makes a `FriendDecl` rather than set a property on an AST node).

tl;dr: this is fine as-is, even if we need to add `clang_Cursor_isConsteval` in the future.

https://github.com/llvm/llvm-project/pull/183305


More information about the cfe-commits mailing list