================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to