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] Unnecessary extra spaces around template brackets #110968

Closed
carlosgalvezp opened this issue Oct 3, 2024 · 9 comments · Fixed by #110971
Closed

[clang-format] Unnecessary extra spaces around template brackets #110968

carlosgalvezp opened this issue Oct 3, 2024 · 9 comments · Fixed by #110971

Comments

@carlosgalvezp
Copy link
Contributor

When bumping from clang-format 18.1.8 to 19.1.1 we notice this change in formatting:

$ cat test.cpp
auto x = std::conditional_t<T::value == U::value, T, U>{};
$ clang-format-19 test.cpp
auto x = std::conditional_t < T::value == U::value, T, U > {};

Notice the extra spaces around the < and >. This happens with default configuration (no .clang-format file). This is also happening in main:
https://godbolt.org/z/9nv3js7qe

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 3, 2024

@llvm/issue-subscribers-clang-format

Author: Carlos Galvez (carlosgalvezp)

When bumping from clang-format 18.1.8 to 19.1.1 we notice this change in formatting:
$ cat test.cpp
auto x = std::conditional_t&lt;T::value == U::value, T, U&gt;{};
$ clang-format-19 test.cpp
auto x = std::conditional_t &lt; T::value == U::value, T, U &gt; {};

Notice the extra spaces around the &lt; and &gt;. This happens with default configuration (no .clang-format file). This is also happening in main:
https://godbolt.org/z/9nv3js7qe

@carlosgalvezp
Copy link
Contributor Author

Thanks for quick the fix @owenca ! Is there any chance to cherrypick it into the 19.x branch?

@owenca
Copy link
Contributor

owenca commented Oct 5, 2024

/cherry-pick e5b05a5

@owenca owenca added this to the LLVM 19.X Release milestone Oct 5, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 5, 2024

Failed to cherry-pick: e5b05a5

https://github.com/llvm/llvm-project/actions/runs/11191943813

Please manually backport the fix and push it to your github fork. Once this is done, please create a pull request

@carlosgalvezp
Copy link
Contributor Author

@owenca I see it failed to cherry-pick, was this handled elsewhere?

@owenca
Copy link
Contributor

owenca commented Oct 7, 2024

This will succeed after #111245 lands.

@carlosgalvezp
Copy link
Contributor Author

Awesome, thanks!

@owenca
Copy link
Contributor

owenca commented Oct 11, 2024

/cherry-pick e5b05a5

llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Oct 11, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 11, 2024

/pull-request #111958

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants