-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6257: Cmake Tests: Delete operator check for size_t arg r=hkaiser a=SAtacker - Clang fails to recognize the global delete operator which has 2 arguments the second one being std::size_t - Reference - https://godbolt.org/z/q1hMrfKjv - Fixes #6246 Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com> Co-authored-by: Shreyas Atre <shreyasatre16@gmail.com> Co-authored-by: Shreyas Atre <61797109+SAtacker@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2023 Shreyas Atre | ||
// | ||
// SPDX-License-Identifier: BSL-1.0 | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
#include <cstddef> | ||
#include <memory> | ||
|
||
/// clang fails to compile this with libstdc++ even though gcc does fine | ||
|
||
int main() | ||
{ | ||
using dealloc_fn = void (*)(void*, std::size_t); | ||
dealloc_fn const dealloc = [](void* const p, std::size_t const s) { | ||
::operator delete[](p, s + sizeof(std::size_t) + sizeof(dealloc_fn)); | ||
}; | ||
(void) dealloc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters