From: Reid Kleckner Date: Tue, 16 Aug 2016 20:20:56 +0000 (+0000) Subject: Try to work around an MSVC 2013 bug around defaulted default ctors X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18235a513ad6541499c976dcbea6ffde90cc3e98;p=clang Try to work around an MSVC 2013 bug around defaulted default ctors An UnresolvedSetIterator() is supposed to be zeroed out, but MSVC 2013 does not do that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278842 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h index 868c5a6e19..b63c6eb217 100644 --- a/include/clang/AST/UnresolvedSet.h +++ b/include/clang/AST/UnresolvedSet.h @@ -38,7 +38,9 @@ class UnresolvedSetIterator : public llvm::iterator_adaptor_base< : iterator_adaptor_base(const_cast(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); }