[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted
Zhihao Yuan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 31 10:10:41 PDT 2019
lichray added a comment.
The functionality looks acceptable. Trying to parse the whole thing still looks fragile to me. I expect code owner to take a look at this change.
================
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.
----------------
Maybe make use of some `TT_TemplateOpener`?
================
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>)>;");
----------------
Does `A() -> A<decltype(foo<traits<1>>)>` (C++11 `>>`) work?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69577/new/
https://reviews.llvm.org/D69577
More information about the cfe-commits
mailing list