From: Chris Lattner Date: Mon, 23 Feb 2009 18:17:44 +0000 (+0000) Subject: Add copy assignment operator, caught by doug. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01011d4e4d6d5146f58233a508509757382d62c3;p=clang Add copy assignment operator, caught by doug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65331 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index eda1e33ba6..18712cde35 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -290,6 +290,15 @@ public: delete &getVector(); } + StoredDeclsList &operator=(const StoredDeclsList &RHS) { + if (isVector()) + delete &getVector(); + Data = RHS.Data; + if (isVector()) + Data.setPointer(new VectorTy(getVector())); + return *this; + } + bool isVector() const { return Data.getInt() != 0; } bool isInline() const { return Data.getInt() == 0; } bool isNull() const { return Data.getPointer() == 0; }