From e06600c5cf184775d2161a4f7b5557a0d13c8653 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 29 Apr 2009 23:37:31 +0000 Subject: [PATCH] Make DISABLE_SMART_POINTERS work, again git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70443 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Parse/Ownership.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/clang/Parse/Ownership.h b/include/clang/Parse/Ownership.h index 652fc46505..54c04c2c4d 100644 --- a/include/clang/Parse/Ownership.h +++ b/include/clang/Parse/Ownership.h @@ -379,6 +379,12 @@ namespace clang { return Node; } + /// Take outside ownership of the raw pointer and cast it down. + template + T *takeAs() { + return static_cast(Node); + } + /// Alias for interface familiarity with unique_ptr. void * release() { return take(); @@ -698,8 +704,9 @@ namespace clang { unsigned size() const { return Count; } void reset(void **args, bool *argIsType, unsigned count) { +#if !defined(DISABLE_SMART_POINTERS) destroy(); - +#endif Args = args; ArgIsType = argIsType; Count = count; -- 2.40.0