diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-13 20:51:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-13 20:51:38 +0000 |
commit | 9509108b3dde280dca1999b5c054f5b789581e68 (patch) | |
tree | a09735820f6041a4288c323370f4181bfedd57db | |
parent | e42ec54dff9c3b9d8935b42a22737b69bbcf7cb0 (diff) |
declare an 'operator delete' to match operator new, this avoids many many
warnings when building with VC++, patch by AlisdairM!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73305 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Attr.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 0427f0003a..a5b7ad4ca3 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -24,10 +24,16 @@ namespace clang { } -// Defined in ASTContext.cpp +// Defined in ASTContext.h void *operator new(size_t Bytes, clang::ASTContext &C, size_t Alignment = 16) throw (); +// It is good practice to pair new/delete operators. Also, MSVC gives many +// warnings if a matching delete overload is not declared, even though the +// throw() spec guarantees it will not be implicitly called. +void operator delete(void *Ptr, clang::ASTContext &C, size_t) + throw (); + namespace clang { /// Attr - This represents one attribute. |