[PATCH] D133659: [Clang] P1169R4: static operator()

2022-09-14 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133659/new/ https://reviews.llvm.org/D133659 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D133659: [Clang] P1169R4: static operator()

2022-09-12 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/test/CodeGenCXX/cxx2b-static-call-operator.cpp:5 +struct Functor { + static int operator()(int x, int y) { +return x + y; I want to see some tests that diagnose `extern operator()`. Comment

[PATCH] D131466: [clang] add APValue type check in `TryPrintAsStringLiteral`

2022-08-09 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray accepted this revision. lichray added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131466/new/ https://reviews.llvm.org/D131466

[PATCH] D119136: [clang] Implement Change scope of lambda trailing-return-type

2022-04-20 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In D119136#3462660 , @aaron.ballman wrote:> > Thanks for the apology, but I still think the reverts were premature, so > hopefully we don't do this again. The issue with reverting all of these is > that you put the burden back

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-03-01 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG44eee659f1c5: [AST] Print NTTP args as string-literals when possible (authored by lichray). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-03-01 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 412289. lichray added a comment. Herald added a project: All. - Add a trigraph test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files:

[PATCH] D120608: [Clang] Remove redundant init-parens in AST print

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd1a59eefd3a0: [Clang] Remove redundant init-parens in AST print (authored by lichray). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG136b29312920: [c++2b] Implement P0849R8 auto(x) (authored by lichray). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 4 inline comments as done. lichray added inline comments. Comment at: clang/include/clang/Basic/CharInfo.h:199-200 +return "\\t"; + case '\v': +return "\\v"; + } aaron.ballman wrote: > lichray wrote: > > aaron.ballman wrote: > > > We're

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 3 inline comments as done. lichray added inline comments. Comment at: clang/include/clang/Basic/CharInfo.h:199-200 +return "\\t"; + case '\v': +return "\\v"; + } aaron.ballman wrote: > We're also missing `\?` right? `?` does not seem to

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411856. lichray added a comment. - Revert some auto's Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D120589: [Clang] Implement decltype(auto)(x) from P0849R2

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411845. lichray added a comment. Restore the right diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120589/new/ https://reviews.llvm.org/D120589 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D120608: [Clang] Remove redundant init-parens in AST print

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411843. lichray marked 2 inline comments as done. lichray added a comment. Nit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120608/new/ https://reviews.llvm.org/D120608 Files: clang/lib/AST/StmtPrinter.cpp

[PATCH] D120589: [Clang] Implement decltype(auto)(x) from P0849R2

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411842. lichray added a comment. Nit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120589/new/ https://reviews.llvm.org/D120589 Files: clang/lib/AST/StmtPrinter.cpp

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411839. lichray added a comment. Use the right copy of clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D120608: [Clang] Remove redundant init-parens in AST print

2022-02-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/AST/StmtPrinter.cpp:2155 - CXXNewExpr::InitializationStyle InitStyle = E->getInitializationStyle(); - if (InitStyle) { -if (InitStyle == CXXNewExpr::CallInit) + auto InitStyle = E->getInitializationStyle(); + if

[PATCH] D120608: [Clang] Remove redundant init-parens in AST print

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Given a dependent `T` (maybe an undeduced `auto`), Before: new T(z) --> new T((z)) # changes meaning with more args new T{z} --> new T{z}

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411571. lichray added a comment. Re-run build Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D120589: [Clang] Implement decltype(auto)(x) from P0849R2

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411511. lichray added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120589/new/ https://reviews.llvm.org/D120589 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411510. lichray edited the summary of this revision. lichray added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files:

[PATCH] D120589: [Clang] Implement decltype(auto)(x) from P0849R2

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In D113393#3345275 , @aaron.ballman wrote: >> Also implemented decltype(auto)(x) (https://wg21.link/p0849r2) as a Clang >> extension. > > I'd like to better understand the use cases for this. WG21 considered this as > part of

[PATCH] D120589: [Clang] Implement decltype(auto)(x) from P0849R2

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. Herald added a subscriber: JDevlieghere. lichray requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. As a Clang extension. See also https://wg21.link/p0849r2 The implementation takes a shortcut by forming

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In D113393#3340878 , @aaron.ballman wrote: > Are there changes needed for the AST printer for this new form of cast > notation? Fixed one pre-existing issue, and now emit legal C++ code, except in one corner case. But

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411493. lichray added a comment. - Remove decltype(auto) from the patch - Parenthesize deduced casts in AST print Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-24 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 411264. lichray added a comment. - Do not overwrite braced inits when forming AST - Explain why losing decltype(auto) as written in AST Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked an inline comment as done. lichray added a comment. In D113393#3340878 , @aaron.ballman wrote: > I spotted some test coverage that I think we should add: > > static_cast(whatever); > reinterpret_cast(whatever); >

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 410915. lichray added a comment. - Add more tests to diagnose other forms of casts Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files:

[PATCH] D120140: [clang-format] Avoid inserting space after C++ casts.

2022-02-18 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1951 +// FIXME: Maybe we should handle identifiers ending with "_cast", +// e.g. bit_cast? +return true; Very unlikely `bit_cast` gives you

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-02-11 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 408137. lichray added a comment. Rerun pre-merge checks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-11 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 2 inline comments as done. lichray added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2396 +def ext_decltype_auto_expr : ExtWarn< + "ISO C++23 DIS does not allow functional-style cast to 'decltype(auto)'">, + InGroup>;

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-11 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 408079. lichray added a comment. - Rephrase a warning message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-02-10 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 407464. lichray added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-10 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 407427. lichray added a comment. - Retarget Clang 15 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2022-02-10 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 407425. lichray added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-01-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 403760. lichray added a comment. Rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D118337: [clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record.

2022-01-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. Looks nice, and works for me. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118337/new/ https://reviews.llvm.org/D118337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-01-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-01-22 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked an inline comment as done. lichray added a comment. Restricted the ellipsis only to diagnosis. Type comparison now shows full initializers, which could be made smarter next time. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-01-21 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 402180. lichray added a comment. - Flip the default and set EntireContentsOfLargeArray off only in diagnosis Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files:

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-01-12 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 399433. lichray added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2022-01-12 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 399415. lichray added a comment. - clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 396408. lichray added a comment. - Put tests in TypePrinterTest.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/include/clang/AST/DeclTemplate.h

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-24 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 2 inline comments as done. lichray added inline comments. Comment at: clang/include/clang/AST/PrettyPrinter.h:288 + /// template parameters, no matter how many elements there are. + unsigned EntireContentsOfLargeArray : 1; + rsmith wrote: > It

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-24 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 396187. lichray marked an inline comment as done. lichray added a comment. Herald added a subscriber: mgorny. - Fix categorizing int64_t chars of negative values - More ArrayRef - Fix and test the EntireContentsOfLargeArray bit Repository: rG LLVM Github

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-15 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. @rsmith Ping. I'm all on you :) You are almost the only one designed these files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 ___

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-12-13 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In D113393#3190788 , @Quuxplusone wrote: > Am I seeing correctly that there's no feature-test macro for `auto(x)`? Oh, no, there isn't, and there wasn't a `__cpp_auto` either. I'll open a core issue. > I basically have to

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-07 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. Ping. Ready to review again. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D114497: [PowerPC] Drop stdlib paths in freestanding tests

2021-12-04 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG41a0e850fa30: [PowerPC] Drop stdlib paths in freestanding tests (authored by lichray). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114497/new/

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-04 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 391833. lichray marked an inline comment as done. lichray added a comment. - Switch to `llvm::SmallString` - Refactor code that prints C-style builtin escape sequences - Stop printing strings with embedded NULs in NTTP types - Add an

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-04 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 5 inline comments as done. lichray added inline comments. Comment at: clang/lib/AST/APValue.cpp:637-639 + // Nothing we can do about a sequence that is not null-terminated + if (!Data[--Size].getInt().isZero()) +return false; lichray wrote:

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/AST/APValue.cpp:637-639 + // Nothing we can do about a sequence that is not null-terminated + if (!Data[--Size].getInt().isZero()) +return false; lichray wrote: > rsmith wrote: > > lichray wrote: > > >

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/AST/APValue.cpp:637-639 + // Nothing we can do about a sequence that is not null-terminated + if (!Data[--Size].getInt().isZero()) +return false; rsmith wrote: > lichray wrote: > > rsmith wrote: > > > We

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/AST/APValue.cpp:628-629 +static bool TryPrintAsStringLiteral(raw_ostream , const ArrayType *ATy, +const APValue *Data, size_t Size) { + if (Size == 0) rsmith wrote: > Is

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 391744. lichray added a comment. Ensure the ellipses output is never shorter than the normal ones (will look at review comments later) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 391718. lichray added a comment. Add EOL to source file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/lib/AST/APValue.cpp

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 391717. lichray added a comment. - Add tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/lib/AST/APValue.cpp

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 391602. lichray added a comment. Restore deleted comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/lib/AST/APValue.cpp Index:

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 391600. lichray added a comment. Fix failed assertion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115031/new/ https://reviews.llvm.org/D115031 Files: clang/lib/AST/APValue.cpp Index:

[PATCH] D115031: [AST] Print NTTP args as string-literals when possible

2021-12-03 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. C++20 NTTP (non-type template parameter) prints `MyType<{{116, 104, 105, 115}}>` when the code is as simple as `MyType<"this">`. Of course, due to the

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-12-01 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked an inline comment as done. lichray added a comment. I reverted the attempt to fix `auto()->n = 0;` in this revision. The fix is definitely not 3 lines and does not fit in this patch. Long story short, our tentative parsing code does not look at trailing return types and fails to

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-12-01 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 390946. lichray added a comment. - revert the tentative parsing fix - warn in -Wpre-c++2b-compat and -Wdecltype-auto-cast (ExtWarn) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 389890. lichray added a comment. Ping. Please review. - Reformat code after clang-format lands D114519 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/

[PATCH] D114519: [clang-format] [PR52595] clang-format does not recognize rvalue references to array

2021-11-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:317 // void ()(void); // void (^ObjCBlock)(void); bool MightBeFunctionType = !Contexts[Contexts.size() - 2].IsExpression; Code does not match comment. CHANGES SINCE

[PATCH] D114497: [Driver] Stop adding stdlib paths in -ffreestanding

2021-11-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 389391. lichray added a comment. Herald added subscribers: kbarton, nemanjai. - Adapt tests instead Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114497/new/ https://reviews.llvm.org/D114497 Files:

[PATCH] D114497: [Driver] Stop adding stdlib paths in -ffreestanding

2021-11-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. Herald added subscribers: krytarowski, arichardson, emaste. lichray requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When targeting FreeBSD on a Linux host with a copy of system libc++, Clang prepends

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In D113393#3128840 , @rsmith wrote: > I also wonder whether we should accept `decltype(auto)(x)` as an extension, > but we can discuss that separately. Implemented. To produce a reference rather than a temporary, I had to

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In D113393#3128835 , @rsmith wrote: > It looks like we'll need some additional work on disambiguation to handle > cases like: > > struct A { int n; } a; > void f() { auto()->n = 0; } > > I think that's valid, but right now

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-23 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 389304. lichray added a comment. - Implement decltype(auto)(x) as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D113826: [clang-format][c++2b] support removal of the space between auto and {} in P0849R8

2021-11-13 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. Thanks for the patch! It works for me, both for the `auto{x}` and `new auto{x}` cases. Some corner cases left: void f() { T()->n = 1; } void f() { T{}->n = 1; } // xxx void g() { auto()->n = 0; } void h() { auto{}->n = 0; } // xxx The `/// xxx` cases are

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-13 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 387017. lichray added a comment. - Manually adjust auto{x} formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-13 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 387016. lichray marked 3 inline comments as done. lichray added a comment. Address review comments - more test cases - render `auto({})` and `new auto({})` invalid - disambiguate `auto(x)->n` that looks like a declaration Repository: rG LLVM Github

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-13 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 10 inline comments as done. lichray added inline comments. Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1032 + // the typename-specifier in a function-style cast expression may + // be 'auto' since C++2b Diag(Tok.getLocation(),

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-08 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 385564. lichray added a comment. Clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-08 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 385454. lichray added a comment. C++2y -> C++2b Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-08 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 385450. lichray added a comment. Document updates Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113393/new/ https://reviews.llvm.org/D113393 Files: clang/docs/ReleaseNotes.rst

[PATCH] D113393: [c++2b] Implement P0849R8 auto(x)

2021-11-08 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. https://wg21.link/p0849 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D113393 Files:

[PATCH] D104222: [clang-format] [PR50702] Lamdba processing does not respect AfterClass and AfterNamespace

2021-06-14 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104222/new/ https://reviews.llvm.org/D104222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D103204: [clang-format] New BreakInheritanceList style AfterComma

2021-05-28 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG09b75f480d1d: [clang-format] New BreakInheritanceList style AfterComma (authored by lichray). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D103204: [clang-format] New BreakInheritanceList style AfterComma

2021-05-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 348424. lichray added a comment. Correct a copy-pasted test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103204/new/ https://reviews.llvm.org/D103204 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D103204: [clang-format] New BreakInheritanceList style AfterComma

2021-05-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/include/clang/Format/Format.h:1839 +/// \endcode +BILS_AfterComma }; HazardyKnusperkeks wrote: > Maybe add a comma, so that the next addition will not need to modify this > line? Sure. Repository:

[PATCH] D103204: [clang-format] New BreakInheritanceList style AfterComma

2021-05-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked an inline comment as done. lichray added a comment. In D103204#2784234 , @MyDeveloperDay wrote: > Adding such a feature like this needs unit tests, it won't be let in without > them, you need to add them to

[PATCH] D103204: [clang-format] New BreakInheritanceList style AfterComma

2021-05-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 348423. lichray added a comment. Add tests and update the release notes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103204/new/ https://reviews.llvm.org/D103204 Files:

[PATCH] D103204: [Format] New BreakInheritanceList style AfterComma

2021-05-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 348164. lichray added a comment. Simplify implementation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103204/new/ https://reviews.llvm.org/D103204 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D103204: [Format] New BreakInheritanceList style AfterComma

2021-05-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 348092. lichray added a comment. Fix typo in docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103204/new/ https://reviews.llvm.org/D103204 Files: clang/docs/ClangFormatStyleOptions.rst

[PATCH] D103204: [Format] New BreakInheritanceList style AfterComma

2021-05-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This inheritance list style has been widely adopted by Symantec, a division of Broadcom Inc. It breaks after the commas that separate the

[PATCH] D64034: [c++] Implement P1957R0 - narrowing pointer-to-bool

2020-12-08 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray abandoned this revision. lichray added a comment. Implemented in 7ef45f45f67 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64034/new/ https://reviews.llvm.org/D64034

[PATCH] D64034: [c++] Implement categorizing pointer-to-bool as narrowing conversions

2019-12-08 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 232752. lichray added a comment. Regenerate the diff in Git, update description, link to paper. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64034/new/ https://reviews.llvm.org/D64034 Files:

[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted

2019-10-31 Thread Zhihao Yuan via Phabricator via cfe-commits
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 &&

[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted

2019-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1354 + static bool isDeductionGuide(FormatToken ) { +// Look for a deduction guide A()...) -> A<...>; +if (Current.Previous && Current.Previous->is(tok::r_paren) &&

[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted

2019-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1400-1403 +} else if (Current.Previous && Current.Previous->is(tok::r_paren) && + Current.startsSequence(tok::arrow, tok::identifier, tok::less)) { + // Deduction guides

[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted

2019-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: clang/lib/Format/TokenAnnotator.cpp:1400 Current.Type = TT_TrailingReturnArrow; +} else if (Current.Previous && Current.Previous->is(tok::r_paren) && + Current.startsSequence(tok::arrow, tok::identifier,

[PATCH] D69577: [clang-format] [PR35518] C++17 deduction guides are wrongly formatted

2019-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. Should we find a way to set `->`'s type to `TT_TrailingReturnArrow`? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69577/new/ https://reviews.llvm.org/D69577 ___ cfe-commits mailing list

[PATCH] D64034: [c++] Implement categorizing pointer-to-bool as narrowing conversions

2019-07-01 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray added reviewers: rsmith, EricWF. lichray added a project: clang. Herald added a subscriber: cfe-commits. This change implements an upcoming Core issue to categorize boolean conversions from pointer and pointer-to-member as (always) narrowing conversion (you

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-06-18 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. lichray marked an inline comment as done. Closed by commit rL363692: [libc++] Implement P0608R3 - A sane variant converting constructor (authored by lichray, committed by ). Herald added a project: LLVM. Herald added a

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-06-10 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 2 inline comments as done. lichray added inline comments. Comment at: test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp:130 { using V = std::variant; static_assert(!std::is_assignable::value, "ambiguous");

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-06-10 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 203966. lichray added a comment. Add fail tests Repository: rCXX libc++ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44865/new/ https://reviews.llvm.org/D44865 Files: include/variant

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-06-09 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 203766. lichray added a comment. Update www Repository: rCXX libc++ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44865/new/ https://reviews.llvm.org/D44865 Files: include/variant

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-06-09 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked an inline comment as done. lichray added a comment. In D44865#1535823 , @zoecarver wrote: > - the spacing is different from the rest of libc++ (a lot of it was that way > before). That's not something I can "fix" in this patch :( > -

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-06-09 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 203733. lichray added a comment. Trivial rebase Repository: rCXX libc++ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44865/new/ https://reviews.llvm.org/D44865 Files: include/variant

[PATCH] D44865: [libc++] Implement P0608R3 - A sane variant converting constructor

2019-02-10 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. Ping @mclow.lists @EricWF ; the patch still applies, is there any other thing I need to address? Repository: rCXX libc++ CHANGES SINCE LAST ACTION https://reviews.llvm.org/D44865/new/ https://reviews.llvm.org/D44865

  1   2   3   >