]> granicus.if.org Git - clang/commitdiff
Enable some more operator overloading tests, and don't look into an identifier for...
authorDouglas Gregor <dgregor@apple.com>
Fri, 21 Nov 2008 15:30:19 +0000 (15:30 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 21 Nov 2008 15:30:19 +0000 (15:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59818 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp
test/SemaCXX/overloaded-builtin-operators.cpp

index e9d5eb75ea486306a1b604b3fce548cb692b5f3f..2e13352a5adde8ec3c191ace510c7bc893b8cd42 100644 (file)
@@ -168,6 +168,9 @@ unsigned CallExpr::isBuiltinCall() const {
   if (!FDecl)
     return 0;
   
+  if (!FDecl->getIdentifier())
+    return 0;
+
   return FDecl->getIdentifier()->getBuiltinID();
 }
 
index 41509f96e77693300cba4e7eba84a307e329007f..284bdb8d3080110c47bc610f5d7b5360833368a3 100644 (file)
@@ -89,14 +89,10 @@ struct ConstIntPtrRef {
 
 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;