[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 clang/include/clang/Basic/

[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 clang/include/clang/AST/Pre

[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 clang/include/cla

[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] 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 clang/includ

[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] 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 base-specifiers

[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 clang/include/cla

[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 clang/incl

[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: clang/docs/ClangFormatStyleOptions.r

[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 clang/unittest/Format/Format.cp

[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: r

[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 cl

[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 L

[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] 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: clang/include/clang/Basic/DiagnosticSemaKinds

[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 clang/include/clang/Basic/Dia

[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 clang/include/clang/Basic/Diagn

[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 clang/include/clang/Basic/Diagnos

[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(), rsm

[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 Monore

[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 clang/inc

[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(&a)->n = 1; } void f() { T{&a}->n = 1; } // xxx void g() { auto(&a)->n = 0; } void h() { auto{&a}->n = 0; } // xxx The `/// xxx` case

[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 clang/in

[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(&a)->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 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 speci

[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 /usr/incl

[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: clang/tes

[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 (&FunctionReference)(void); // void (^ObjCBlock)(void); bool MightBeFunctionType = !Contexts[Contexts.size() - 2].IsExpression; Code does not match comment.

[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/ https://revi

[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/ https://reviews.llvm

[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(&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

[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] 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: clang/lib/AST/APValue

[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: clang/lib/AST/APVa

[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 clang/test/SemaTemplate/temp_arg_str

[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 clang/test/SemaTemplate/t

[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/ https://reviews.

[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 &Out, const ArrayType *ATy, +const APValue *Data, size_t Size) { + if (Size == 0) rsmith 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: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: > > > rs

[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-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 `EntireContentsOfLargeArra

[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/ https://rev

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

2019-10-29 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 cfe-

[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, tok::les

[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 trailin

[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 &Current) { +// Look for a deduction guide A()...) -> A<...>; +if (Current.Previous && Current.Previous->is(tok::r_paren) && Pa

[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 && Current.Previous->is(t

[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: clang/lib/Sema/

[PATCH] D41458: [libc++][C++17] Elementary string conversions for integral types

2018-03-22 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 3 inline comments as done. lichray added inline comments. Comment at: include/charconv:234 +to_chars(char* __first, char* __last, _Tp __value, int __base) +-> to_chars_result +{ mclow.lists wrote: > Why use the trailing return type here? > I do

[PATCH] D41458: [libc++][C++17] Elementary string conversions for integral types

2018-03-22 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 139422. lichray added a comment. Reorganize files Repository: rCXX libc++ https://reviews.llvm.org/D41458 Files: .gitignore include/charconv src/charconv.cpp test/std/utilities/charconv/ test/std/utilities/charconv/charconv.from.chars/ test/s

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2018-03-23 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC328409: [C++17] Fix class template argument deduction for default constructors without… (authored by lichray, committed by ). Repository: rC Clang https://reviews.llvm.org/D38216 Files: lib/Sema/Sem

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

2018-03-24 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray added reviewers: EricWF, mpark, mclow.lists. Herald added a subscriber: christof. "Boolshit shall not prevail," LEWG says. References: http://wg21.link/P0608R1 Repository: rCXX libc++ https://reviews.llvm.org/D44865 Files: include/variant test/std

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

2018-03-24 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 139704. lichray added a comment. Use less traits Repository: rCXX libc++ https://reviews.llvm.org/D44865 Files: include/variant test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp test/std/utilities/variant/variant.variant/variant.

[PATCH] D44823: [libcxx] Improving std::vector and std::deque perfomance

2018-03-25 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. Something `std::byte` couldn't help lol Repository: rCXX libc++ https://reviews.llvm.org/D44823 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D44661: [libcxx] optimize reduce(), hmin(), hmax() by reordering the operations.

2018-03-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: libcxx/include/experimental/simd:2096 +template +std::array::size() / 2, _Abi>>, 2> +__deinterleave(const simd<_Tp, _Abi>& __v) { Too long. Consider a traits? https://reviews.llvm.org/D44661 __

[PATCH] D44661: [libcxx] optimize reduce(), hmin(), hmax() by reordering the operations.

2018-03-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: libcxx/include/experimental/simd:2196 +typename _SimdType::value_type>::type +__hmax(const _SimdType& __v) { auto __acc = __v[0]; These conditions are too long, consider ``` __hmax_impl(const _

[PATCH] D44823: [libcxx] Improving std::vector and std::deque perfomance

2018-03-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: libcxx/trunk/include/__split_buffer:201 __alloc_rr& __a = this->__alloc(); +pointer __to_be_end = this->__end_; do mclow.lists wrote: > I have been asked specifically by the optimizer folks to NOT do things

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

2018-03-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked an inline comment as done. lichray added a comment. In https://reviews.llvm.org/D44865#1048880, @EricWF wrote: > Has this paper been adopted into the standard yet? No. However, it cleanly passed LEWG for recommending a DR against C++17, so I think we can apply it early, just li

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

2018-03-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 139882. lichray added a comment. Keep changes small Repository: rCXX libc++ https://reviews.llvm.org/D44865 Files: include/variant test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp test/std/utilities/variant/variant.variant/varia

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

2018-03-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: include/variant:1109 +#define _LIBCPP_VARIANT_BOOLEAN_CONVERSION(bool_type)\ +template\ lichray wrote: > EricWF wrote: > > EricWF wrote: > > > I would

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

2018-03-26 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: include/variant:1109 +#define _LIBCPP_VARIANT_BOOLEAN_CONVERSION(bool_type)\ +template\ EricWF wrote: > lichray wrote: > > EricWF wrote: > > > lichray

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

2018-03-27 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 140029. lichray added a comment. Macro-free Repository: rCXX libc++ https://reviews.llvm.org/D44865 Files: include/variant test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp test/std/utilities/variant/variant.variant/variant.ctor/

[PATCH] D45002: [test] Conservatively re-enable a FreeBSD/XRay test

2018-03-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. lichray added reviewers: devnexen, krytarowski. Herald added subscribers: dberris, emaste. Fixing clang-test on FreeBSD as a follow-up of https://reviews.llvm.org/D43378 to handle the revert happened in r325749. Repository: rC Clang https://reviews.llvm.org/D45

[PATCH] D45002: [test] Conservatively re-enable a FreeBSD/XRay test

2018-03-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: test/Driver/XRay/xray-instrument-os.c:2 // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s -// XFAIL: -linux- +// XFAIL: -linux-, -freebsd // REQUIRES-ANY: amd64, x86_64, x86_64h, arm, aarch64, arm64 devnexen w

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

2018-03-28 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 140188. lichray added a comment. More tests Repository: rCXX libc++ https://reviews.llvm.org/D44865 Files: include/variant test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp test/std/utilities/variant/variant.variant/variant.ctor/

[PATCH] D45002: [test] Fix an XRay test on FreeBSD

2018-03-29 Thread Zhihao Yuan via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rC328797: [test] Fix an XRay test on FreeBSD (authored by lichray, committed by ). Changed prior to commit: https://revie

[PATCH] D41347: [libc++] Lift std::errc into a separated header

2018-04-05 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 141109. lichray added a comment. Herald added a subscriber: christof. Update module map Repository: rCXX libc++ https://reviews.llvm.org/D41347 Files: include/__errc include/module.modulemap include/system_error Index: include/system_error ===

[PATCH] D41458: [libc++][C++17] Elementary string conversions for integral types

2018-04-05 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 141110. lichray added a comment. Update module map Repository: rCXX libc++ https://reviews.llvm.org/D41458 Files: .gitignore include/charconv include/module.modulemap src/charconv.cpp test/std/utilities/charconv/ test/std/utilities/charconv/c

[PATCH] D39284: [c++2a] Decomposed _condition_

2017-10-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In https://reviews.llvm.org/D39284#906450, @aaron.ballman wrote: > I'm not opposed to the functionality, but this isn't a part of C++2a either; > I think we should be diagnosing this code with a warning so users don't > expect it to work on every compiler. C++2a the s

[PATCH] D39284: [c++2a] Decomposed _condition_

2017-10-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In https://reviews.llvm.org/D39284#906860, @aaron.ballman wrote: > I'm aware, but I was unaware that we've accepted this functionality in C++2a > yet within WG21. Did we vote this in and I simply didn't remember it? No. In the first line of the Summary I said this has

[PATCH] D39284: [c++2a] Decomposed _condition_

2017-10-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 120295. lichray added a comment. One more test case https://reviews.llvm.org/D39284 Files: include/clang/Sema/DeclSpec.h lib/Parse/ParseExprCXX.cpp lib/Sema/SemaDeclCXX.cpp test/Parser/cxx2a-decomposition.cpp test/SemaCXX/cxx2a-decomposition.cpp

[PATCH] D39284: [c++2a] Decomposed _condition_

2017-10-25 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In https://reviews.llvm.org/D39284#906899, @aaron.ballman wrote: > We typically diagnose vendor extensions to the language, and I think we > should apply that consistently. Otherwise, your code will compile fine in > Clang with warning levels cranked all the way up and

[PATCH] D39412: [Driver] Give LIBRARY_PATH precedence over native toolchains

2017-10-29 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. Herald added subscribers: aheejin, jgravelle-google, sbc100, nhaehnle, dschuff, jfb, emaste. `LIBRARY_PATH` expansion should happen before expanding native toolchains' linker arguments, if any, to allow overriding the default standard libraries to link. GCC suppo

[PATCH] D39284: [c++2a] Decomposed _condition_

2017-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 120913. lichray added a comment. Make the feature unconditional with an `ExtWarn` https://reviews.llvm.org/D39284 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/DeclSpec.h lib/Parse/ParseExprCXX.cpp lib/Sema/SemaDeclCXX.cpp t

[PATCH] D39284: Allow conditions to be decomposed with structured bindings

2017-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray marked 3 inline comments as done. lichray added inline comments. Comment at: lib/Sema/SemaDeclCXX.cpp:696-698 + // a for-range-declaration, or a condition in C++2a, but we parse it in more + // cases than that. + if (!D.mayHaveDecompositionDeclarator(getLangOpts())) {

[PATCH] D39284: Allow conditions to be decomposed with structured bindings

2017-10-30 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 120922. lichray marked an inline comment as done. lichray added a comment. Tweak coding style https://reviews.llvm.org/D39284 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/DeclSpec.h lib/Parse/ParseExprCXX.cpp lib/Sema/SemaDec

[PATCH] D39451: P0620 follow-up: deducing `auto` from braced-init-list in new expr

2017-10-31 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray created this revision. This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from `auto` and `decltype(auto)`) to be usable in a `new` expression with a single-clause //braced-init-list// as its initializer (8.3.4 [expr.new]/2). N3922 defined its se

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2017-11-11 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. The standard hasn't allowed deducing any placeholder type without an initializer (10.1.7.4.1 [dcl.type.auto.deduct]/2) yet. It's unclear to me what extern A x; wants to archive. Usually when people writing `extern` then expect an initializer to appear somewhere els

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2017-11-11 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In https://reviews.llvm.org/D38216#922709, @Rakete wrote: > @lichray Isn't [dcl.type.auto.deduct] only for `auto` and `decltype(auto)`? Sorry, reasoned on a confusingly similar part... Here is updated information: > 10.1.7.5 [dcl.type.class.deduct] > If a placehol

[PATCH] D38216: [C++17] Fix class template argument deduction for default constructors without an initializer

2017-11-13 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added a comment. In https://reviews.llvm.org/D38216#923580, @rsmith wrote: > That's almost right, but not all `extern` declarations are disallowed. (An > `extern` declaration is still a defining declaration if it has an > initializer.) Good to know, thanks. So gcc got this wrong? ht

[PATCH] D41458: [libc++][C++17] Elementary string conversions for integral types

2018-01-12 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray updated this revision to Diff 129714. lichray added a comment. src/support/itoa/itoa.cpp in previous diffs were copyrighted by Tencent, now LLVM, contributed by the same author. Repository: rCXX libc++ https://reviews.llvm.org/D41458 Files: .gitignore include/charconv include/

[PATCH] D41844: [libcxx] implement mask reductions

2018-01-18 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: libcxx/include/experimental/simd:1561 +template > +_Tp reduce(const simd<_Tp, _Abi>& __v, _BinaryOp __op = _BinaryOp()) { Specified in terms of the transparent `plus<>`. https://reviews.llvm.org/D41844 ___

[PATCH] D41843: [libcxx] implement where expressions.

2018-01-18 Thread Zhihao Yuan via Phabricator via cfe-commits
lichray added inline comments. Comment at: libcxx/include/experimental/simd:2330 + simd<_Tp, _Abi>& __v) noexcept { + return where_expression, simd<_Tp, _Abi>>(__m, __v); +} style: `return {__m, __v};`? https://reviews.llvm.org/D41843 _

[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-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 https://reviews.llvm.org/D115031/n

[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 https://lists.llvm.org/cg

[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 h

[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 clang/include/clang/AST/Pre

[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 somethin

[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: clang/docs/ReleaseNotes.rs

[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); > const_cast(whatever)

[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/ https://reviews.

[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 File

[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 `CXXUnre

[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 CXXFunc

[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 t

[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: clang/docs/ReleaseNote

[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 clang/lib/Sema/Sem

<    1   2   3   >