[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted
MyDeveloperDay via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 31 11:31:10 PDT 2019
MyDeveloperDay added inline comments.
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1371
+ if (Current.Previous && Current.Previous->is(tok::r_paren) &&
+ Current.startsSequence(tok::arrow, tok::identifier, tok::less)) {
+ // Find the TemplateCloser.
----------------
lichray wrote:
> Maybe make use of some `TT_TemplateOpener`?
We can't use TT_TemplateOpener because like MatchParen it hasn't been set yet on the downstream tokens
================
Comment at: clang/unittests/Format/FormatTest.cpp:4987
+ "array(T &&... t) -> array<std::common_type_t<T...>, sizeof...(T)>;");
+ verifyFormat("A() -> A<decltype(p->foo<3>())>;");
+ verifyFormat("A() -> A<sizeof(p->foo<1>)>;");
----------------
lichray wrote:
> Does `A() -> A<decltype(foo<traits<1>>)>` (C++11 `>>`) work?
this should work because we are skipping everything in between the `(....)`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69577/new/
https://reviews.llvm.org/D69577
More information about the cfe-commits
mailing list