[cfe-commits] r90719 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp

Douglas Gregor dgregor at apple.com
Sun Dec 6 13:27:59 PST 2009


Author: dgregor
Date: Sun Dec  6 15:27:58 2009
New Revision: 90719

URL: http://llvm.org/viewvc/llvm-project?rev=90719&view=rev
Log:
PointerUnion == PointerUnion does not do what I thought it did. Also, fix a thinko in a PointerUnion::get call.

Added:
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp   (with props)
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp   (with props)
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp   (with props)
Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=90719&r1=90718&r2=90719&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Sun Dec  6 15:27:58 2009
@@ -222,7 +222,7 @@
     if (NamedDecl *ND = DeclOrIterator.dyn_cast<NamedDecl *>())
       return reference(ND, SingleDeclIndex);
 
-    return *DeclOrIterator.get<DeclIndexPair*>();
+    return *DeclOrIterator.get<const DeclIndexPair*>();
   }
 
   pointer operator->() const {
@@ -230,13 +230,13 @@
   }
 
   friend bool operator==(const iterator &X, const iterator &Y) {
-    return X.DeclOrIterator == Y.DeclOrIterator &&
+    return X.DeclOrIterator.getOpaqueValue()
+                                  == Y.DeclOrIterator.getOpaqueValue() &&
       X.SingleDeclIndex == Y.SingleDeclIndex;
   }
 
   friend bool operator!=(const iterator &X, const iterator &Y) {
-    return X.DeclOrIterator != Y.DeclOrIterator ||
-      X.SingleDeclIndex != Y.SingleDeclIndex;
+    return !(X == Y);
   }
 };
 

Added: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp?rev=90719&view=auto

==============================================================================
    (empty)

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp

------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp

------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp?rev=90719&view=auto

==============================================================================
    (empty)

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp

------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p3.cpp

------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp?rev=90719&view=auto

==============================================================================
    (empty)

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp

------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp

------------------------------------------------------------------------------
    svn:mime-type = text/plain





More information about the cfe-commits mailing list