declaration names, from Jim Goodnow II!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117970
91177308-0d34-0410-b5e6-
96231b3b80d8
return false;
// Get the name of the callee. If it's a builtin, strip off the prefix.
- llvm::StringRef Name = FD->getName();
+ IdentifierInfo *II = FD->getIdentifier();
+ if (!II) // if no identifier, not a simple C function
+ return false;
+ llvm::StringRef Name = II->getName();
if (Name.startswith("__builtin_"))
Name = Name.substr(10);
if (!R)
return;
- llvm::StringRef FName = R->getDecl()->getName();
+ IdentifierInfo *II = R->getDecl()->getIdentifier();
+ if (!II) // if no identifier, not a simple C function
+ return;
+ llvm::StringRef FName = II->getName();
if (FName == "pthread_mutex_lock") {
if (CE->getNumArgs() != 1)
--- /dev/null
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-experimental-checks -verify %s
+struct X0 { };
+bool operator==(const X0&, const X0&);
+
+// PR7287
+struct test { int a[2]; };
+
+void t2() {
+ test p = {{1,2}};
+ test q;
+ q = p;
+}
+
+bool PR7287(X0 a, X0 b) {
+ return a == b;
+}