Enable some more operator overloading tests, and don't look into an identifier for functions that might not have one
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59818 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index e9d5eb7..2e13352 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -168,6 +168,9 @@
if (!FDecl)
return 0;
+ if (!FDecl->getIdentifier())
+ return 0;
+
return FDecl->getIdentifier()->getBuiltinID();
}
diff --git a/test/SemaCXX/overloaded-builtin-operators.cpp b/test/SemaCXX/overloaded-builtin-operators.cpp
index 41509f9..284bdb8 100644
--- a/test/SemaCXX/overloaded-builtin-operators.cpp
+++ b/test/SemaCXX/overloaded-builtin-operators.cpp
@@ -89,14 +89,10 @@
void test_with_ptrs(VolatileIntPtr vip, ConstIntPtr cip, ShortRef sr,
VolatileIntPtrRef vipr, ConstIntPtrRef cipr) {
-#if 0
- // FIXME: Enable these tests once we have operator overloading for
- // operator[].
const int& cir1 = cip[sr];
const int& cir2 = sr[cip];
volatile int& vir1 = vip[sr];
volatile int& vir2 = sr[vip];
-#endif
bool b1 = (vip == cip);
long p1 = vip - cip;