Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks more or less correct, but I am afraid that this change may misbehave in some rare cases.
Consider *[](auto *x) { return x; }();, so an immediately invoked lambda returning a pointer.
It seems to be correctly formatted currently, but I don't see any test on it.
Could you add a test for this please?
clang/unittests/Format/FormatTest.cpp | ||
---|---|---|
3342 | How about int const *, const int*? Is const & co. a simple type specifier? |
I currently don't know exactly how isSimpleTypeSpecifier works, but what is with
auto x = Foo * []{return 5;}();
auto x = Foo * *[]{static y = 5; return &y;}();
Now that we look ahead instead of looking back, it doesn't matter what comes before *[] or [].
clang/unittests/Format/FormatTest.cpp | ||
---|---|---|
3342 | It doesn't matter what comes before *[] now that we look ahead for a >. |
How about int const *, const int*? Is const & co. a simple type specifier?