================
@@ -9614,6 +9641,22 @@ unsigned clang_CXXMethod_isExplicit(CXCursor C) {
   return 0;
 }
 
+unsigned clang_Cursor_isConstexpr(CXCursor C) {
+  if (!clang_isDeclaration(C.kind))
+    return 0;
+
+  const Decl *D = cxcursor::getCursorDecl(C);
+  if (!D)
+    return 0;
+
+  if (const auto *VD = dyn_cast<VarDecl>(D))
----------------
AaronBallman wrote:

Can we have a test for lambda expressions too?
```
auto lam = [](int x, int y) constexpr { return x + y; };
```
I think this gets filtered out by the check for a declaration above, but do we 
want this to return true for a lambda expression that's constexpr? I think so.

Additionally, this may not handle variable or function templates correctly, 
should add test coverage for those cases too.

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