r207027 - Moved operator delete to public area to appease gcc and conform to C++ standard.
Richard Smith
richard at metafoo.co.uk
Wed Apr 23 14:46:37 PDT 2014
On Wed, Apr 23, 2014 at 2:28 PM, Abramo Bagnara
<abramo.bagnara at bugseng.com>wrote:
> Author: abramo
> Date: Wed Apr 23 16:28:18 2014
> New Revision: 207027
>
> URL: http://llvm.org/viewvc/llvm-project?rev=207027&view=rev
> Log:
> Moved operator delete to public area to appease gcc and conform to C++
> standard.
>
> Modified:
> cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
>
> Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h?rev=207027&r1=207026&r2=207027&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (original)
> +++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h Wed Apr 23
> 16:28:18 2014
> @@ -104,6 +104,12 @@ public:
> return ::operator new(S, R);
> }
>
> + // SExpr objects cannot be deleted.
> + // This declaration is public to avoid breaking gcc compilation
> + // with REQUIRES_EH=1.
> + // The access check is also mandated by C++11 5.3.4p17 and former
> standards.
>
This comment is false. "the deallocation function" here is the one
corresponding to the allocation function. Per p20, there is no deallocation
function matching the allocation function we use here. This is simply
public to work around a GCC bug.
> + void operator delete(void *) LLVM_DELETED_FUNCTION;
> +
> protected:
> SExpr(TIL_Opcode Op) : Opcode(Op), Reserved(0), Flags(0) {}
> SExpr(const SExpr &E) : Opcode(E.Opcode), Reserved(0), Flags(E.Flags) {}
> @@ -115,9 +121,8 @@ protected:
> private:
> SExpr() LLVM_DELETED_FUNCTION;
>
> - // SExpr objects must be created in an arena and cannot be deleted.
> + // SExpr objects must be created in an arena.
> void *operator new(size_t) LLVM_DELETED_FUNCTION;
> - void operator delete(void *) LLVM_DELETED_FUNCTION;
> };
>
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140423/8669350b/attachment.html>
More information about the cfe-commits
mailing list