From: Dylan Noblesmith Date: Wed, 7 Mar 2012 00:01:18 +0000 (+0000) Subject: AST: fix build since r152060 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29293cddc682091a16a71f513e605995473f7f45;p=clang AST: fix build since r152060 The declarations of the operators no longer matched. The definitions in ASTContext.h had 'throw()' removed, but it was still present in Attr.h. Somehow the buildbots missed this. clang merely warns about a missing 'throw()' specification and suggested a Fix-It adding it back, but gcc 4.5 is not so forgiving and gives an error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152167 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 67876170e4..3bdac2de9a 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -1914,6 +1914,9 @@ static inline Selector GetUnarySelector(StringRef name, ASTContext& Ctx) { /// This placement form of operator new uses the ASTContext's allocator for /// obtaining memory. /// +/// IMPORTANT: These are also declared in clang/AST/Attr.h! Any changes here +/// need to also be made there. +/// /// We intentionally avoid using a nothrow specification here so that the calls /// to this operator will not perform a null check on the result -- the /// underlying allocator never returns null pointers. diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 55c9cb59e5..ef1aa25662 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -40,19 +40,17 @@ namespace clang { // Defined in ASTContext.h void *operator new(size_t Bytes, const clang::ASTContext &C, - size_t Alignment = 16) throw (); + size_t Alignment = 16); // FIXME: Being forced to not have a default argument here due to redeclaration // rules on default arguments sucks void *operator new[](size_t Bytes, const clang::ASTContext &C, - size_t Alignment) throw (); + size_t Alignment); // 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, const clang::ASTContext &C, size_t) - throw (); -void operator delete[](void *Ptr, const clang::ASTContext &C, size_t) - throw (); +void operator delete(void *Ptr, const clang::ASTContext &C, size_t); +void operator delete[](void *Ptr, const clang::ASTContext &C, size_t); namespace clang {