[cfe-commits] r73305 - /cfe/trunk/include/clang/AST/Attr.h
Chris Lattner
sabre at nondot.org
Sat Jun 13 13:51:38 PDT 2009
Author: lattner
Date: Sat Jun 13 15:51:38 2009
New Revision: 73305
URL: http://llvm.org/viewvc/llvm-project?rev=73305&view=rev
Log:
declare an 'operator delete' to match operator new, this avoids many many
warnings when building with VC++, patch by AlisdairM!
Modified:
cfe/trunk/include/clang/AST/Attr.h
Modified: cfe/trunk/include/clang/AST/Attr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Attr.h?rev=73305&r1=73304&r2=73305&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Attr.h (original)
+++ cfe/trunk/include/clang/AST/Attr.h Sat Jun 13 15:51:38 2009
@@ -24,10 +24,16 @@
}
-// 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.
More information about the cfe-commits
mailing list