EricWF added a comment. In https://reviews.llvm.org/D45015#1123164, @ahatanak wrote:
> In https://reviews.llvm.org/D45015#1123097, @EricWF wrote: > > > In https://reviews.llvm.org/D45015#1121874, @ahatanak wrote: > > > > > I see, thank you. > > > > > > clang front-end currently fails to issue a warning or error when an > > > aligned allocation/deallocation functions are required but not available > > > in a few cases (e.g., delete called from a deleting destructor, calls to > > > operator or builtin operator new/delete). I suppose those bugs should be > > > fixed in separate patches. > > > > > > I don't think we need to emit warnings from > > `__builtin_operator_new`/`__builtin_operator_delete`. Libc++ is the only > > consumer, and I think we can trust it to know what it's doing. > > > Shouldn't clang warn when users explicitly call an aligned builtin operator > new or delete in their code and the OS is too old to support the operator? > > For example: > > typedef __SIZE_TYPE__ size_t; > namespace std { > enum class align_val_t : size_t {}; > } > > int main() { > void *p = __builtin_operator_new(100, std::align_val_t(32)); > return 0; > } > Yeah, I think you're right. Initially I thought `__builtin_operator_new` was documented as being intended for usage only in the STL, but it doesn't quite say that. I have a patch which moves the checks into `DiagnoseUseOfDecl`, which should catch all of the cases we haven't already handled. https://reviews.llvm.org/D45015 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits