================
@@ -570,9 +573,11 @@ til::SExpr *SExprBuilder::translateCallExpr(const CallExpr 
*CE,
 til::SExpr *SExprBuilder::translateCXXMemberCallExpr(
     const CXXMemberCallExpr *ME, CallingContext *Ctx) {
   if (CapabilityExprMode) {
-    // Ignore calls to get() on smart pointers.
-    if (ME->getMethodDecl()->getNameAsString() == "get" &&
-        ME->getNumArgs() == 0) {
+    // Ignore calls to get() on smart pointers. A call through a pointer to
+    // member function has no method declaration.
+    const CXXMethodDecl *MD = ME->getMethodDecl();
+    if (ME->getNumArgs() == 0 && MD && MD->getIdentifier() &&
----------------
aaronpuchert wrote:

What would be an example of a `CXXMethodDecl` that can appear in a 
`CXXMethodDecl` but has no identifier? Operators perhaps?

https://github.com/llvm/llvm-project/pull/231995
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to