Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-format] No space after placement new in member initializer list #54703

Open
aeubanks opened this issue Apr 1, 2022 · 3 comments
Open

Comments

@aeubanks
Copy link
Contributor

aeubanks commented Apr 1, 2022

#include <new>
struct A {
  void *a;
  A(void *p) : a(new(p) int) {}
};

clang-format doesn't want to add a space after the new even though I believe that's the standard practice.

@llvmbot
Copy link
Member

llvmbot commented Apr 1, 2022

@llvm/issue-subscribers-clang-format

@zmodem
Copy link
Collaborator

zmodem commented Apr 4, 2022

Bisection points to:

commit dbc4d281bd6954362ccfc0747893ceaae842671b
Author: Luis Penagos <[email protected]>
Date:   Thu Feb 24 09:48:24 2022 +0100

    [clang-format] Do not insert space after new/delete keywords in C function declarations
    
    Fixes https://github.com/llvm/llvm-project/issues/46915.
    
    Reviewed By: curdeius, HazardyKnusperkeks
    
    Differential Revision: https://reviews.llvm.org/D120374

@nico
Copy link
Contributor

nico commented Apr 4, 2022

(clicky: dbc4d28, https://reviews.llvm.org/D120374, #46915)

owenca pushed a commit that referenced this issue Oct 20, 2023
Add AfterPlacementNew option to SpaceBeforeParensOptions to have more
control on placement new expressions.

Fixes #41501
Relates to #54703

Differential Revision: https://reviews.llvm.org/D127270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants