diff options
Diffstat (limited to 'lld/ELF/Memory.h')
-rw-r--r-- | lld/ELF/Memory.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/Memory.h b/lld/ELF/Memory.h index b7cf18be7d6..6ea6022992c 100644 --- a/lld/ELF/Memory.h +++ b/lld/ELF/Memory.h @@ -49,9 +49,9 @@ template <class T> struct SpecificAlloc : public SpecificAllocBase { // Use this arean if your object have a destructor. // Your destructor will be invoked from freeArena(). -template <class T> static T *alloc() { +template <typename T, typename... U> static T *make(U &&... Args) { static SpecificAlloc<T> Alloc; - return Alloc.Alloc.Allocate(); + return new (Alloc.Alloc.Allocate()) T(std::forward<U>(Args)...); } void freeArena(); |