We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here is a small example that demonstrates the bug:
#include <variant> // Utilities for working with std::variant. Taken from // https://en.cppreference.com/w/cpp/utility/variant/visit template <class... Ts> struct overloaded : Ts... { using Ts::operator()...; }; template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>; namespace ns { void foo() { std::variant<int, double> v; std::visit(overloaded{[](auto &&) -> int (*)[] { return nullptr; }}, v); } } // namespace ns
After formatting:
#include <variant> // Utilities for working with std::variant. Taken from // https://en.cppreference.com/w/cpp/utility/variant/visit template <class... Ts> struct overloaded : Ts... { using Ts::operator()...; }; template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>; namespace ns { void foo() { std::variant<int, double> v; std::visit(overloaded{[](auto &&) -> int (*)[] { return nullptr; } } // namespace ns , v); } } // namespace ns
The bug also appears if the return type is std::unique_ptr<int[]>. It does not appear when the return type doesn't have [], e.g. int *.
std::unique_ptr<int[]>
[]
int *
I suspect that it's related to #27146 and #40694, but I'm not certain.
.clang-format:
.clang-format
BasedOnStyle: LLVM
clang-format --version:
clang-format --version
clang-format version 13.0.0 (Fedora 13.0.0-3.fc35)
The text was updated successfully, but these errors were encountered:
Review: https://reviews.llvm.org/D116553.
Sorry, something went wrong.
e2b6e21
mkurdej
No branches or pull requests
Here is a small example that demonstrates the bug:
After formatting:
The bug also appears if the return type is
std::unique_ptr<int[]>
. It does not appear when the return type doesn't have[]
, e.g.int *
.I suspect that it's related to #27146 and #40694, but I'm not certain.
.clang-format
:clang-format --version
:The text was updated successfully, but these errors were encountered: