Try to work around an MSVC 2013 bug around defaulted default ctors
authorReid Kleckner <rnk@google.com>
Tue, 16 Aug 2016 20:20:56 +0000 (20:20 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 16 Aug 2016 20:20:56 +0000 (20:20 +0000)
An UnresolvedSetIterator() is supposed to be zeroed out, but MSVC 2013
does not do that.

llvm-svn: 278842

clang/include/clang/AST/UnresolvedSet.h

index 868c5a6..b63c6eb 100644 (file)
@@ -38,7 +38,9 @@ class UnresolvedSetIterator : public llvm::iterator_adaptor_base<
       : iterator_adaptor_base(const_cast<DeclAccessPair *>(Iter)) {}
 
 public:
-  UnresolvedSetIterator() = default;
+  // Work around a bug in MSVC 2013 where explicitly default constructed
+  // temporaries with defaulted ctors are not zero initialized.
+  UnresolvedSetIterator() : iterator_adaptor_base(nullptr) {}
 
   NamedDecl *getDecl() const { return I->getDecl(); }
   void setDecl(NamedDecl *ND) const { return I->setDecl(ND); }