diff options
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/AST/ParentMapContext.h')
-rw-r--r-- | contrib/llvm-project/clang/include/clang/AST/ParentMapContext.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/llvm-project/clang/include/clang/AST/ParentMapContext.h b/contrib/llvm-project/clang/include/clang/AST/ParentMapContext.h index be4d75df7b99..a0412380a864 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ParentMapContext.h +++ b/contrib/llvm-project/clang/include/clang/AST/ParentMapContext.h @@ -94,25 +94,24 @@ class DynTypedNodeList { public: DynTypedNodeList(const DynTypedNode &N) : IsSingleNode(true) { - new (Storage.buffer) DynTypedNode(N); + new (&Storage) DynTypedNode(N); } DynTypedNodeList(ArrayRef<DynTypedNode> A) : IsSingleNode(false) { - new (Storage.buffer) ArrayRef<DynTypedNode>(A); + new (&Storage) ArrayRef<DynTypedNode>(A); } const DynTypedNode *begin() const { if (!IsSingleNode) - return reinterpret_cast<const ArrayRef<DynTypedNode> *>(Storage.buffer) + return reinterpret_cast<const ArrayRef<DynTypedNode> *>(&Storage) ->begin(); - return reinterpret_cast<const DynTypedNode *>(Storage.buffer); + return reinterpret_cast<const DynTypedNode *>(&Storage); } const DynTypedNode *end() const { if (!IsSingleNode) - return reinterpret_cast<const ArrayRef<DynTypedNode> *>(Storage.buffer) - ->end(); - return reinterpret_cast<const DynTypedNode *>(Storage.buffer) + 1; + return reinterpret_cast<const ArrayRef<DynTypedNode> *>(&Storage)->end(); + return reinterpret_cast<const DynTypedNode *>(&Storage) + 1; } size_t size() const { return end() - begin(); } |