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

Formatting does not work in the if statement in the λ expression to the right of the assignment statement #108727

Open
Ebola-Chan-bot opened this issue Sep 15, 2024 · 1 comment

Comments

@Ebola-Chan-bot
Copy link

Ebola-Chan-bot commented Sep 15, 2024

This issue is redirected from vscode-cpptools

std::function<void()> A;
std::function<void()> *B;
B = &(A = [&B]()
	 { if(B)B=nullptr; });
auto a = []()
{				int a=1;
				a=2; };

Formatting should add spaces to B=nullptr in the last line. But in fact, spaces are not added after formatting:
image

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 15, 2024

@llvm/issue-subscribers-clang-format

Author: 埃博拉酱 (Silver-Fang)

This issue is redirected from [vscode-cpptools](https://github.com/microsoft/vscode-cpptools/issues/12382) ```C++ std::function<void()> A; std::function<void()> *B; B = &(A = [&B]() { if(B)B=nullptr; }); auto a = []() { int a=1; a=2; }; ``` Formatting should add spaces to B=nullptr in the last line. But in fact, spaces are not added after formatting: ![image](https://github.com/user-attachments/assets/d6853ac6-f1cd-490f-8abb-77ac4139e906)

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

3 participants