Page MenuHomePhabricator

lichray (Zhihao Yuan)
Spy

Projects

User does not belong to any projects.

User Details

User Since
Oct 21 2017, 7:38 PM (251 w, 3 d)

Recent Activity

Wed, Aug 10

lichray requested changes to D130631: [libc++] Implement P0288R9 (move_only_function).
Wed, Aug 10, 12:17 PM · Restricted Project, Restricted Project

Tue, Aug 9

lichray accepted D131466: [clang] add APValue type check in `TryPrintAsStringLiteral`.

LGTM

Tue, Aug 9, 12:25 PM · Restricted Project, Restricted Project

Jun 7 2022

lichray added a comment to D127033: [libc++] Define ostream nullptr inserter for >= C++17 only.

Also, Billy O'Neal reported that the new overload caused ambiguities for some morally questionable code in Google Test, which was trying to define it's own overload for this type. Breaking existing code (even if it's bad code) is another reason to not enable it unconditionally. I guess that's no longer an issue, or somebody would have noticed it when using gtest and libc++!

It seems like the only known uses for this operator<< are in Boost.Test, Google Test, and Mozilla's assertion macros ... so I super don't care about it.

Jun 7 2022, 10:24 AM · Restricted Project, Restricted Project

Jun 3 2022

lichray accepted D127033: [libc++] Define ostream nullptr inserter for >= C++17 only.
Jun 3 2022, 4:22 PM · Restricted Project, Restricted Project

Apr 20 2022

lichray added a comment to D119136: [clang] Implement Change scope of lambda trailing-return-type.

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 onto a relatively new contributor to try to figure out how to reapply all these changes when there wasn't actually a need to do so.

In terms of where we go from here, there's a few options:

  1. revert the reverts; this is easiest, but causes the most churn
  2. merge all three patches into one (squashed) patch and commit that; this requires a little bit more work, but causes less churn
  3. assume that P2036R3 is not implementable until WG21 resolves CWG2569 because it breaks too much code

I think I have a preference for #2 as that will hopefully leave us with the most clear git history for when we do a blame later, but I could live with #1. If we find that there is significant broken code still, but it's not in system headers, then I think we should explore #3, but I don't think we have evidence that we're in this situation either.

Apr 20 2022, 12:13 PM · Restricted Project, Restricted Project

Mar 25 2022

lichray abandoned D120589: [Clang] Implement decltype(auto)(x) from P0849R2.
Mar 25 2022, 9:34 AM · Restricted Project, Restricted Project

Mar 1 2022

lichray committed rG44eee659f1c5: [AST] Print NTTP args as string-literals when possible (authored by lichray).
[AST] Print NTTP args as string-literals when possible
Mar 1 2022, 5:37 PM · Restricted Project
lichray closed D115031: [AST] Print NTTP args as string-literals when possible.
Mar 1 2022, 5:37 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Add a trigraph test case
Mar 1 2022, 4:34 PM · Restricted Project, Restricted Project

Feb 28 2022

lichray committed rGd1a59eefd3a0: [Clang] Remove redundant init-parens in AST print (authored by lichray).
[Clang] Remove redundant init-parens in AST print
Feb 28 2022, 5:32 PM
lichray closed D120608: [Clang] Remove redundant init-parens in AST print.
Feb 28 2022, 5:31 PM · Restricted Project
lichray committed rG136b29312920: [c++2b] Implement P0849R8 auto(x) (authored by lichray).
[c++2b] Implement P0849R8 auto(x)
Feb 28 2022, 5:21 PM
lichray closed D113393: [c++2b] Implement P0849R8 auto(x).
Feb 28 2022, 5:21 PM · Restricted Project
lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Feb 28 2022, 2:15 PM · Restricted Project, Restricted Project
lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Feb 28 2022, 11:44 AM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Revert some auto's
Feb 28 2022, 11:34 AM · Restricted Project, Restricted Project
lichray updated the diff for D120589: [Clang] Implement decltype(auto)(x) from P0849R2.

Restore the right diff

Feb 28 2022, 10:42 AM · Restricted Project, Restricted Project
lichray updated the diff for D120608: [Clang] Remove redundant init-parens in AST print.

Nit

Feb 28 2022, 10:41 AM · Restricted Project
lichray updated the diff for D120589: [Clang] Implement decltype(auto)(x) from P0849R2.
Feb 28 2022, 10:39 AM · Restricted Project, Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Use the right copy of clang-format

Feb 28 2022, 10:33 AM · Restricted Project
lichray added inline comments to D120608: [Clang] Remove redundant init-parens in AST print.
Feb 28 2022, 10:19 AM · Restricted Project

Feb 25 2022

lichray added reviewers for D120608: [Clang] Remove redundant init-parens in AST print: aaron.ballman, cor3ntin.
Feb 25 2022, 8:58 PM · Restricted Project
lichray requested review of D120608: [Clang] Remove redundant init-parens in AST print.
Feb 25 2022, 8:56 PM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Re-run build

Feb 25 2022, 8:55 PM · Restricted Project
lichray added a reviewer for D115031: [AST] Print NTTP args as string-literals when possible: aaron.ballman.
Feb 25 2022, 1:26 PM · Restricted Project, Restricted Project
lichray updated the diff for D120589: [Clang] Implement decltype(auto)(x) from P0849R2.

Rebase

Feb 25 2022, 1:24 PM · Restricted Project, Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Rebase

Feb 25 2022, 1:22 PM · Restricted Project
lichray added a comment to D120589: [Clang] Implement decltype(auto)(x) from P0849R2.

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 the feature and ultimately rejected it (fairly strongly, according to the EWG polls). From the meeting minutes, [...]

Feb 25 2022, 1:17 PM · Restricted Project, Restricted Project
lichray added reviewers for D120589: [Clang] Implement decltype(auto)(x) from P0849R2: aaron.ballman, cor3ntin, Quuxplusone.
Feb 25 2022, 12:54 PM · Restricted Project, Restricted Project
lichray requested review of D120589: [Clang] Implement decltype(auto)(x) from P0849R2.
Feb 25 2022, 12:51 PM · Restricted Project, Restricted Project
lichray added a comment to D113393: [c++2b] Implement P0849R8 auto(x).

Are there changes needed for the AST printer for this new form of cast notation?

Feb 25 2022, 12:34 PM · Restricted Project
lichray updated the summary of D113393: [c++2b] Implement P0849R8 auto(x).
Feb 25 2022, 12:21 PM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Remove decltype(auto) from the patch
  • Parenthesize deduced casts in AST print
Feb 25 2022, 12:21 PM · Restricted Project

Feb 24 2022

lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Do not overwrite braced inits when forming AST
  • Explain why losing decltype(auto) as written in AST
Feb 24 2022, 4:38 PM · Restricted Project

Feb 23 2022

lichray added a comment to D113393: [c++2b] Implement P0849R8 auto(x).

I spotted some test coverage that I think we should add:

static_cast<auto>(whatever);
reinterpret_cast<auto>(whatever);
const_cast<auto>(whatever);
dynamic_cast<auto>(whatever);
(auto)whatever;
Feb 23 2022, 1:21 PM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Add more tests to diagnose other forms of casts
Feb 23 2022, 12:47 PM · Restricted Project

Feb 18 2022

lichray added inline comments to D120140: [clang-format] Avoid inserting space after C++ casts..
Feb 18 2022, 10:53 AM · Restricted Project

Feb 11 2022

lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.

Rerun pre-merge checks

Feb 11 2022, 6:54 PM · Restricted Project, Restricted Project
lichray added inline comments to D113393: [c++2b] Implement P0849R8 auto(x).
Feb 11 2022, 4:22 PM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Rephrase a warning message
Feb 11 2022, 3:22 PM · Restricted Project

Feb 10 2022

lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.

Rebased

Feb 10 2022, 3:51 AM · Restricted Project, Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Retarget Clang 15
Feb 10 2022, 1:58 AM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
Rebased
Feb 10 2022, 1:55 AM · Restricted Project

Jan 29 2022

lichray added a comment to D118551: [ELF] De-template LinkerDriver::link. NFC.

LGTM

Jan 29 2022, 11:55 PM · Restricted Project
lichray updated subscribers of D118551: [ELF] De-template LinkerDriver::link. NFC.

@rsmith, your suggestion in 2017 solves this issue:

Jan 29 2022, 11:38 PM · Restricted Project

Jan 27 2022

lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.

Rebased

Jan 27 2022, 12:45 PM · Restricted Project, Restricted Project
lichray added a comment to D118337: [clang-format] Fix AllowShortFunctionsOnASingleLine: InlineOnly with wrapping after record..

Looks nice, and works for me (as in https://github.com/llvm/llvm-project/issues/53430).

Jan 27 2022, 5:27 AM · Restricted Project, Restricted Project

Jan 26 2022

lichray accepted D117976: [SmallVector] Optimize move assignment operator for N==0 case.
Jan 26 2022, 12:25 AM · Restricted Project, Restricted Project

Jan 25 2022

lichray added inline comments to D117976: [SmallVector] Optimize move assignment operator for N==0 case.
Jan 25 2022, 5:45 PM · Restricted Project, Restricted Project
lichray added a comment to D115031: [AST] Print NTTP args as string-literals when possible.

Ping.

Jan 25 2022, 10:21 AM · Restricted Project, Restricted Project

Jan 23 2022

lichray added inline comments to D117976: [SmallVector] Optimize move assignment operator for N==0 case.
Jan 23 2022, 2:08 AM · Restricted Project, Restricted Project

Jan 22 2022

lichray added a comment to D115031: [AST] Print NTTP args as string-literals when possible.

Restricted the ellipsis only to diagnosis. Type comparison now shows full initializers, which could be made smarter next time.

Jan 22 2022, 12:11 AM · Restricted Project, Restricted Project

Jan 21 2022

lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Flip the default and set EntireContentsOfLargeArray off only in diagnosis
Jan 21 2022, 11:08 PM · Restricted Project, Restricted Project

Jan 12 2022

lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
Rebase
Jan 12 2022, 1:34 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • clang-format
Jan 12 2022, 12:13 PM · Restricted Project, Restricted Project

Dec 28 2021

lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Put tests in TypePrinterTest.cpp
Dec 28 2021, 9:46 AM · Restricted Project, Restricted Project

Dec 24 2021

lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Dec 24 2021, 11:06 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Fix categorizing int64_t chars of negative values
  • More ArrayRef
  • Fix and test the EntireContentsOfLargeArray bit
Dec 24 2021, 10:53 PM · Restricted Project, Restricted Project

Dec 22 2021

lichray accepted D116143: [ELF] Change some global pointers to unique_ptr.
Dec 22 2021, 12:14 PM · Restricted Project
lichray added a comment to D116143: [ELF] Change some global pointers to unique_ptr.

Looks reasonable to me.

Dec 22 2021, 12:40 AM · Restricted Project

Dec 15 2021

lichray added a comment to D115031: [AST] Print NTTP args as string-literals when possible.

@rsmith Ping. I'm all on you :) You are almost the only one designed these files.

Dec 15 2021, 2:27 PM · Restricted Project, Restricted Project

Dec 13 2021

lichray added a comment to D113393: [c++2b] Implement P0849R8 auto(x).

Am I seeing correctly that there's no feature-test macro for auto(x)?

Dec 13 2021, 6:28 PM · Restricted Project

Dec 7 2021

lichray added a comment to D115031: [AST] Print NTTP args as string-literals when possible.

Ping. Ready to review again.

Dec 7 2021, 10:56 AM · Restricted Project, Restricted Project

Dec 4 2021

lichray committed rG41a0e850fa30: [PowerPC] Drop stdlib paths in freestanding tests (authored by lichray).
[PowerPC] Drop stdlib paths in freestanding tests
Dec 4 2021, 2:51 PM
lichray closed D114497: [PowerPC] Drop stdlib paths in freestanding tests.
Dec 4 2021, 2:51 PM · Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Switch to llvm::SmallString
  • Refactor code that prints C-style builtin escape sequences
  • Stop printing strings with embedded NULs in NTTP types
  • Add an EntireContentsOfLargeArray pretty-print policy
Dec 4 2021, 5:22 AM · Restricted Project, Restricted Project
lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Dec 4 2021, 5:21 AM · Restricted Project, Restricted Project

Dec 3 2021

lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Dec 3 2021, 9:15 PM · Restricted Project, Restricted Project
lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Dec 3 2021, 8:39 PM · Restricted Project, Restricted Project
lichray added inline comments to D115031: [AST] Print NTTP args as string-literals when possible.
Dec 3 2021, 3:32 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.

Ensure the ellipses output is never shorter than the normal ones (will look at review comments later)

Dec 3 2021, 2:51 PM · Restricted Project, Restricted Project
lichray updated the summary of D115031: [AST] Print NTTP args as string-literals when possible.
Dec 3 2021, 1:54 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.

Add EOL to source file

Dec 3 2021, 1:05 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
  • Add tests
Dec 3 2021, 1:04 PM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.
Dec 3 2021, 3:36 AM · Restricted Project, Restricted Project
lichray updated the diff for D115031: [AST] Print NTTP args as string-literals when possible.

Fix failed assertion

Dec 3 2021, 3:28 AM · Restricted Project, Restricted Project
lichray added reviewers for D115031: [AST] Print NTTP args as string-literals when possible: rsmith, dexonsmith, Tyker.
Dec 3 2021, 2:33 AM · Restricted Project, Restricted Project
lichray requested review of D115031: [AST] Print NTTP args as string-literals when possible.
Dec 3 2021, 1:32 AM · Restricted Project, Restricted Project

Dec 1 2021

lichray added a comment to D113393: [c++2b] Implement P0849R8 auto(x).

I reverted the attempt to fix auto(&a)->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 disambiguate template <class T> void e(auto (*p)(T y) -> decltype(y())) {} if it is still ambiguous after seen auto (. The following files have more interesting cases:

CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
CXX/dcl/dcl.fct/p17.cpp
CodeGenCXX/mangle-exprs.cpp
Parser/cxx0x-ambig.cpp
Parser/cxx1z-decomposition.cpp
SemaCXX/trailing-return-0x.cpp
SemaTemplate/alias-templates.cpp

and not all of them are correct. It needs a closer look in a future issue.

Dec 1 2021, 1:22 AM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • revert the tentative parsing fix
  • warn in -Wpre-c++2b-compat and -Wdecltype-auto-cast (ExtWarn)
Dec 1 2021, 1:05 AM · Restricted Project

Nov 25 2021

lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Ping. Please review.

Nov 25 2021, 5:06 PM · Restricted Project
lichray added inline comments to D114519: [clang-format] [PR52595] clang-format does not recognize rvalue references to array.
Nov 25 2021, 1:26 AM · Restricted Project, Restricted Project

Nov 23 2021

lichray retitled D114497: [PowerPC] Drop stdlib paths in freestanding tests from [Driver] Stop adding stdlib paths in -ffreestanding to [PowerPC] Drop stdlib paths in freestanding tests.
Nov 23 2021, 10:08 PM · Restricted Project
lichray updated the diff for D114497: [PowerPC] Drop stdlib paths in freestanding tests.
  • Adapt tests instead
Nov 23 2021, 10:06 PM · Restricted Project
lichray added reviewers for D114497: [PowerPC] Drop stdlib paths in freestanding tests: jbeich, adalava, MaskRay.
Nov 23 2021, 8:32 PM · Restricted Project
lichray requested review of D114497: [PowerPC] Drop stdlib paths in freestanding tests.
Nov 23 2021, 8:26 PM · Restricted Project
lichray added a comment to D113393: [c++2b] Implement P0849R8 auto(x).

I also wonder whether we should accept decltype(auto)(x) as an extension, but we can discuss that separately.

Nov 23 2021, 1:34 PM · Restricted Project
lichray added a comment to D113393: [c++2b] Implement P0849R8 auto(x).

It looks like we'll need some additional work on disambiguation to handle cases like:

struct A { int n; } a;
void f() { auto(&a)->n = 0; }

I think that's valid, but right now we misparse it as a declaration of a variable &a. [...]:

struct A { int n; } a;
using T = A*;
void f() { T(&a)->n = 1; }
Nov 23 2021, 1:29 PM · Restricted Project
lichray updated the summary of D113393: [c++2b] Implement P0849R8 auto(x).
Nov 23 2021, 1:25 PM · Restricted Project
lichray updated the summary of D113393: [c++2b] Implement P0849R8 auto(x).
Nov 23 2021, 1:24 PM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Implement decltype(auto)(x) as well
Nov 23 2021, 1:22 PM · Restricted Project

Nov 13 2021

lichray added a comment to D113826: [clang-format][c++2b] support removal of the space between auto and {} in P0849R8.

Thanks for the patch! It works for me, both for the auto{x} and new auto{x} cases. Some corner cases left:

Nov 13 2021, 11:45 AM · Restricted Project, Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).
  • Manually adjust auto{x} formatting
Nov 13 2021, 6:04 AM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Address review comments

Nov 13 2021, 5:34 AM · Restricted Project
lichray added inline comments to D113393: [c++2b] Implement P0849R8 auto(x).
Nov 13 2021, 5:30 AM · Restricted Project

Nov 10 2021

lichray added reviewers for D113393: [c++2b] Implement P0849R8 auto(x): aaron.ballman, faisalv.
Nov 10 2021, 11:10 AM · Restricted Project

Nov 8 2021

lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Clang-format

Nov 8 2021, 10:47 AM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

C++2y -> C++2b

Nov 8 2021, 4:25 AM · Restricted Project
lichray added reviewers for D113393: [c++2b] Implement P0849R8 auto(x): rsmith, cor3ntin.
Nov 8 2021, 4:22 AM · Restricted Project
lichray updated the diff for D113393: [c++2b] Implement P0849R8 auto(x).

Document updates

Nov 8 2021, 4:20 AM · Restricted Project