[clang-tools-extra] [clangd] Allow hover over 128-bit variable without crashing (PR #71415)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Allow hover over 128-bit variable without crashing (PR #71415)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thank you! I didn't realize that `getActiveBits` was calculated by the count of leading zeros, even for negative numbers. This generally looks good modulo a question on the test. https://github.com/llvm/llvm-project/pull/71415 ___

[clang-tools-extra] [clangd] Allow hover over 128-bit variable without crashing (PR #71415)

2023-11-06 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,29 @@ +# RUN: clangd -lit-test < %s | FileCheck %s zyn0217 wrote: Rather than creating a lit-test, could you please move it to the `HoverTests.cpp` under the unittests directory? That would be more straightforward, and I think we could add the case t

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
zyn0217 wrote: On second thought I think I should not kill all the expressions involving `PseudoObjectExpr`: I'm not sure if our ObjC / CUDA support does need that for presenting useful hints. https://github.com/llvm/llvm-project/pull/71366 ___ cfe-c

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71366 >From 4a878b63cbdd33833b998896120a992178438180 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/3] [clangd] Don't show inlay hints for PseudoObjectExprs in C++

[clang-tools-extra] [clangd] Allow hover over 128-bit variable without crashing (PR #71415)

2023-11-07 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks! Please go ahead and merge it. :-) https://github.com/llvm/llvm-project/pull/71415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Correctly identify the next token after the completion point (PR #69153)

2023-11-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/69153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Correctly identify the next token after the completion point (PR #69153)

2023-11-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. I'd like to approve the patch boldly since the findTokenAfterCompletionPoint is mostly duplicated from `Lexer::findNextToken` except for a difference that our version calls `Loc.getLocWithOffset(1)` rather than MeasureTokenLength() for the

[clang-tools-extra] [clangd] Correctly identify the next token after the completion point (PR #69153)

2023-11-08 Thread Younan Zhang via cfe-commits
@@ -1491,6 +1491,46 @@ FuzzyFindRequest speculativeFuzzyFindRequestForCompletion( return CachedReq; } +// This function is similar to Lexer::findNextToken(), but assumes +// that the input SourceLocation is the completion point (which is +// a case findNextToken() does not

[clang-tools-extra] [clangd] Correctly identify the next token after the completion point (PR #69153)

2023-11-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/69153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Correctly identify the next token after the completion point (PR #69153)

2023-11-08 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/69153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71279 >From d73a8e2ee683e6812c21cb1de7363b14565a96d1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 4 Nov 2023 18:43:58 +0800 Subject: [PATCH 1/2] [clangd] Resolve the dependent type from its single instantiat

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-10 Thread Younan Zhang via cfe-commits
@@ -150,6 +246,11 @@ std::vector HeuristicResolver::resolveMemberExpr( if (ME->isArrow()) { BaseType = getPointeeType(BaseType); } + + if (BaseType->isDependentType()) zyn0217 wrote: I don't know if I should assume the non-nullity for `BaseType`: All

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71279 >From d73a8e2ee683e6812c21cb1de7363b14565a96d1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 4 Nov 2023 18:43:58 +0800 Subject: [PATCH 1/3] [clangd] Resolve the dependent type from its single instantiat

[clang] [clang][Sema] Avoid non-empty unexpanded pack assertion for FunctionParmPackExpr (PR #69224)

2023-11-12 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/69224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-12 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > If so, get its TemplateTypeParmDecl, find the template whose parameter it is, > and see if the template has a getOnlyInstantiation. Thanks for the suggestion! Admittedly, it looks neat and terse. However, I suspect it won't work with the present `TemplateTypeParm{Type,Decl}` m

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-13 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Is it not possible to tell based on the `CallExpr` only (rather than checking > an ancestor of it during traversal of the tree) that "this `CallExpr` is not > explicitly written in the source"? I'm not quite sure - Looking into the construction process for a `__builtin_dump_s

[clang] [Sema] Check nullness of captured type before use (PR #72230)

2023-11-14 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Could you please explain why the `CaptureType` might be null at the time when exercising `tryCaptureVariable`? I'm worried that doing so would hide a more significant issue. https://github.com/llvm/llvm-project/pull/72230 ___ cfe-commi

[clang] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-12-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/72749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-12-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/72749 >From d23305db7faba1ed1464aeee6d9e0f2ee1994226 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/2] [clang] Reject incomplete type arguments for __builtin_dump_st

[clang] [llvm] [clang-tools-extra] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-12-04 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks! Added the link. https://github.com/llvm/llvm-project/pull/72749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-12-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/72749 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-12-09 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @HighCommander4 While at the `HeuristicResolver`, I think we may have a bug inside `HighlightingsBuilder` defined in `SemanticHighlighting.cpp`. https://github.com/llvm/llvm-project/blob/6ed9a81f7ebd23f125867dd270785dd0e63043c6/clang-tools-extra/clangd/SemanticHighlighting.cpp#L5

[clang-tools-extra] [clangd] Initialize HighlightingsBuilder::Resolver (PR #74971)

2023-12-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thank you! LGTM modulo one nit: could you please remove the nullptr member initializer for `Resolver`? That looks unnecessary now. https://github.com/llvm/llvm-project/pull/74971 ___ cfe-commits m

[clang] [clang] Correctly implement CWG 2672 (PR #75001)

2023-12-10 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/75001 This is a follow-up patch for [D156993](https://reviews.llvm.org/D156993), that marks only the lambda body as non-immediate context. Fixes https://github.com/llvm/llvm-project/issues/71684 >From 8681b3c9f5e19b6

[clang] [clang] Correctly implement CWG 2672 (PR #75001)

2023-12-10 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Note I'm not adding an extra release note since the previous implementation has done that and hasn't been cherry-picked or released yet. https://github.com/llvm/llvm-project/pull/75001 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-17 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Out of curiosity, I dialled into today's LLVM office hours and asked Aaron > Ballman about this Thank you so much for making the effort on this issue. :) > ...just change the code for building the invented CallExprs to give them an > invalid SourceLocation Interesting idea a

[clang] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-11-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/72749 We used to assume that the CXXRecordDecl passed to the 1st argument always had a definition. This is not true since a pointer to an incomplete type was not excluded. >From d23305db7faba1ed1464aeee6d9e0f2ee19942

[clang] [clang-tools-extra] [clang] Turn invented Exprs' source locations in __builtin_dump_struct to empty (PR #72750)

2023-11-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/72750 This reflects the comment in https://github.com/llvm/llvm-project/pull/71366#issuecomment-1817271492. As that PR suggests, the invented CallExpr's source location previously pointed to the beginning of the `__b

[clang] [clang-tools-extra] [clang] Turn invented Exprs' source locations in __builtin_dump_struct to empty (PR #72750)

2023-11-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > The CI run shows the test > [Sema/builtin-dump-struct.c](https://searchfox.org/llvm/source/clang/test/Sema/builtin-dump-struct.c) > is failing. Oops, I didn't even realize there's such a test for C. I had only run the Sema/builtin-dump-struct.cpp locally and it passed. :( >

[clang-tools-extra] [clang] [clang] Turn invented Exprs' source locations in __builtin_dump_struct to empty (PR #72750)

2023-11-19 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/72750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-11-19 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/72749 >From d23305db7faba1ed1464aeee6d9e0f2ee1994226 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/2] [clang] Reject incomplete type arguments for __builtin_dump_st

[clang] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-11-19 Thread Younan Zhang via cfe-commits
@@ -713,6 +713,11 @@ static ExprResult SemaBuiltinDumpStruct(Sema &S, CallExpr *TheCall) { return ExprError(); } const RecordDecl *RD = PtrArgType->getPointeeType()->getAsRecordDecl(); + if (!RD->isCompleteDefinition()) { zyn0217 wrote: Thank you! Ad

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-19 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71366 >From 808c141c34218dd542b00149216adc061567dd31 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/4] [clangd] Don't show inlay hints for PseudoObjectExprs in C++

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Since the other PR turned out to be infeasible, I'm overriding `TraversePseudoObjectExpr` now. https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
@@ -1724,6 +1724,33 @@ TEST(InlayHints, RestrictRange) { ElementsAre(labelIs(": int"), labelIs(": char"))); } +TEST(ParameterHints, PseudoObjectExpr) { + Annotations Code(R"cpp( +struct S { + __declspec(property(get=GetX, put=PutX)) int x[]; + int

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
@@ -1724,6 +1724,33 @@ TEST(InlayHints, RestrictRange) { ElementsAre(labelIs(": int"), labelIs(": char"))); } +TEST(ParameterHints, PseudoObjectExpr) { + Annotations Code(R"cpp( +struct S { + __declspec(property(get=GetX, put=PutX)) int x[]; + int

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
@@ -589,6 +589,24 @@ class InlayHintVisitor : public RecursiveASTVisitor { return true; } + bool TraversePseudoObjectExpr(PseudoObjectExpr *E) { +// Do not show inlay hints for the __builtin_dump_struct, which would +// expand to a PseudoObjectExpr that include

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
@@ -1724,6 +1724,33 @@ TEST(InlayHints, RestrictRange) { ElementsAre(labelIs(": int"), labelIs(": char"))); } +TEST(ParameterHints, PseudoObjectExpr) { + Annotations Code(R"cpp( +struct S { + __declspec(property(get=GetX, put=PutX)) int x[]; + int

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71366 >From 808c141c34218dd542b00149216adc061567dd31 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/5] [clangd] Don't show inlay hints for PseudoObjectExprs in C++

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71366 >From 808c141c34218dd542b00149216adc061567dd31 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/6] [clangd] Don't show inlay hints for PseudoObjectExprs in C++

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thank you for working on this! Some nit comments, hope you don't mind. (Also invited some clang folks to have a detailed look at this. :=) https://github.com/llvm/llvm-project/pull/70548 ___ cfe-commits mailing li

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-29 Thread Younan Zhang via cfe-commits
@@ -3553,6 +3553,56 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifie

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-29 Thread Younan Zhang via cfe-commits
@@ -3553,6 +3553,56 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifie

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-29 Thread Younan Zhang via cfe-commits
@@ -3553,6 +3553,56 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifie

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-29 Thread Younan Zhang via cfe-commits
@@ -3553,6 +3553,56 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifie

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-29 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/70548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-30 Thread Younan Zhang via cfe-commits
@@ -3553,6 +3553,49 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifie

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/70548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/71279 This is an enhancement to the HeuristicResolver, trying to extract the deduced type from the single instantiation for a template. This partially addresses the point #1 from https://github.com/clangd/clangd/issue

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-04 Thread Younan Zhang via cfe-commits
@@ -46,6 +50,98 @@ const Type *resolveDeclsToType(const std::vector &Decls, return nullptr; } +// Visitor that helps to extract deduced type from instantiated entities. +// This merely performs the source location comparison against each Decl +// until it finds a Decl with t

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Don't show inlay hints for PseudoObjectExprs in C++ (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/71366 This closes https://github.com/clangd/clangd/issues/1813. PseudoObjectExprs in C++ are currently not very interesting but probably mess up inlay hints. >From 4a878b63cbdd33833b998896120a992178438180 Mon Sep 17

[clang-tools-extra] [clangd] Don't show inlay hints for PseudoObjectExprs in C++ (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71366 >From 4a878b63cbdd33833b998896120a992178438180 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 6 Nov 2023 16:50:02 +0800 Subject: [PATCH 1/2] [clangd] Don't show inlay hints for PseudoObjectExprs in C++

[clang-tools-extra] [clangd] Don't show inlay hints for PseudoObjectExprs (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Don't show inlay hints for PseudoObjectExprs (PR #71366)

2023-11-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71366 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Concepts] Avoid substituting into constraints for invalid TemplateDecls (PR #75697)

2023-12-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/75697 Fixes https://github.com/llvm/llvm-project/issues/73885. Substituting into constraints for invalid TemplateDecls might still yield dependent expressions and end up crashing later while attempting evaluation. >F

[clang] [Concepts] Avoid substituting into constraints for invalid TemplateDecls (PR #75697)

2023-12-18 Thread Younan Zhang via cfe-commits
@@ -353,6 +353,10 @@ static ExprResult calculateConstraintSatisfaction( if (Inst.isInvalid()) return ExprError(); + // An empty expression for substitution failure messages. + if (Template && Template->isInvalidDecl()) +retur

[clang-tools-extra] [clang] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: In addition to Nathan’s advice, I have a question about the commit message > if the functions override a noexcept virtual function. I didn't see anything reflecting this condition; are you still working on this patch? Would you mind adding a WIP prefix to the title before everythi

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > ...which is called during code completion to generate the override function > declarator based on the FunctionDecl of the virtual function in the base. The place you're patching is not only specific to "completing override functions", but handles all completion strings involvi

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Bonus: It appears that neither gcc nor clang implements a provision change from [CWG1351](https://cplusplus.github.io/CWG/issues/1351.html), > [except.spec]p4 > ..., **unless the overriding function is defined as deleted.** giving errors on the following code. ```cpp struct B {

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Maybe this deserves a new issue for clang Sema? Sounds reasonable to me. Feel free to put up a PR / issue for this if you are interested. https://github.com/llvm/llvm-project/pull/75937 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang] Use the materialized temporary's type while creating the APValue (PR #73355)

2023-11-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/73355 See https://github.com/llvm/llvm-project/issues/72025 for the bug and its diagnosis. >From 3ff1b189cf55d3705b2823dc39eaaf710fa26541 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 25 Nov 2023 02:01:22 +0

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-26 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thank you again for bothering with this, and sorry for not responding for over a week. Just now, I replicated the experimentation > I've done some local experimentation, and what I'm seeing is that > `TemplateTypeParmDecl::getDeclContext()` does return the FunctionDecl or > CX

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-11-26 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > I also discovered some complications related to nested templates, and I have > some thoughts on how to resolve them, but I'm going to suggest that we start > with getting a simple case (e.g. just one level of templates, no nested > templates) to work, and then tackle nested te

[clang] [clang] Use the materialized temporary's type while creating the APValue (PR #73355)

2023-11-30 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Ping. And invited @cor3ntin to kindly take a look at this. https://github.com/llvm/llvm-project/pull/73355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use the materialized temporary's type while creating the APValue (PR #73355)

2023-11-30 Thread Younan Zhang via cfe-commits
zyn0217 wrote: The code-formatter failed on other unrelated lines, so I think I'd better not to touch them. https://github.com/llvm/llvm-project/pull/73355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang-tools-extra] [clangd] Don't show inlay hints for __builtin_dump_struct (PR #71366)

2023-11-30 Thread Younan Zhang via cfe-commits
@@ -589,6 +589,24 @@ class InlayHintVisitor : public RecursiveASTVisitor { return true; } + bool TraversePseudoObjectExpr(PseudoObjectExpr *E) { +// Do not show inlay hints for the __builtin_dump_struct, which would +// expand to a PseudoObjectExpr that include

[clang] [clang] Use the materialized temporary's type while creating the APValue (PR #73355)

2023-11-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/73355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-12-24 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Another issue I've encountered while at it is that, given the following code, ```cpp void foo(); auto lambda = [] { return ^foo(); }; ``` let `N` represent the selection node for the expression `foo()`, `N.getDeclContext()` then yields `TranslationUnitDecl` rather than the `CXX

[clang-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2023-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/76329 We used to consider the `DeclContext` for selection nodes inside a lambda as the enclosing scope of the lambda expression, rather than the lambda itself. For example, ```cpp void foo(); auto lambda = [] { ret

[clang-tools-extra] [WIP][clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/71279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [WIP][clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 converted_to_draft https://github.com/llvm/llvm-project/pull/71279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [WIP][clangd] Resolve the dependent type from its single instantiation. Take 1 (PR #71279)

2023-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/71279 >From c0703d7d9549e82434b37f9d5658b566a480d752 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 4 Nov 2023 18:43:58 +0800 Subject: [PATCH 1/4] [clangd] Resolve the dependent type from its single instantiat

[clang-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2023-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/76329 >From c0b04507075b39e494d3e6fa39168bc47b92f338 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 24 Dec 2023 18:08:30 +0800 Subject: [PATCH 1/2] [clangd] Handle lambda scopes inside Node::getDeclContext()

[clang-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2023-12-24 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/76329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Correctly implement CWG 2672 (PR #75001)

2023-12-28 Thread Younan Zhang via cfe-commits
zyn0217 wrote: friendly ping~ https://github.com/llvm/llvm-project/pull/75001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2023-12-31 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Ping. And Happy New Year 2024! https://github.com/llvm/llvm-project/pull/76329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for your contribution! A couple of nit-picks, and I’d leave the approval to other folks. https://github.com/llvm/llvm-project/pull/76668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[llvm] [clang] [clang-tools-extra] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/76668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clang] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-01 Thread Younan Zhang via cfe-commits
@@ -813,6 +813,21 @@ TEST(SourceCodeTests, isKeywords) { EXPECT_FALSE(isKeyword("override", LangOpts)); } +TEST(SourceCodeTests, isSpelledInSource) { + Annotations Test(R"cpp( +int abc = 1; +)cpp"); + + ParsedAST AST = TestTU::withCode(Test.code()).build(); +

[llvm] [clang] [clang-tools-extra] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-01 Thread Younan Zhang via cfe-commits
@@ -232,7 +232,12 @@ bool isSpelledInSource(SourceLocation Loc, const SourceManager &SM) { if (Loc.isFileID()) return true; auto Spelling = SM.getDecomposedSpellingLoc(Loc); - StringRef SpellingFile = SM.getSLocEntry(Spelling.first).getFile().getName(); + bool Invali

[llvm] [clang] [clang-tools-extra] [clangd] Fix is spelled in source bug (PR #76668)

2024-01-01 Thread Younan Zhang via cfe-commits
@@ -232,7 +232,12 @@ bool isSpelledInSource(SourceLocation Loc, const SourceManager &SM) { if (Loc.isFileID()) return true; auto Spelling = SM.getDecomposedSpellingLoc(Loc); - StringRef SpellingFile = SM.getSLocEntry(Spelling.first).getFile().getName(); + bool Invali

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/76811 This fixes the bug introduced by https://github.com/llvm/llvm-project/commit/6db007a0654ed7a6ed5c3aa3b61a937c19a6bc6b. We construct placeholder template arguments for template-template parameters to avoid mismat

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I realized this still crashes the code with NTTP. I will look into this. ```cpp template concept C = false; template struct S {}; template typename T> auto wow(T ts) { return ts.x; } int main() { return wow<3>(S{}); } ``` https://github.com/llvm/llvm-project/pull/76811 __

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-04 Thread Younan Zhang via cfe-commits
zyn0217 wrote: It is interesting to note that, if we exchange the position of two template parameters, i.e. ```cpp template concept C = false; template struct S {}; template typename T, unsigned N> // The template-template parameter now precedes the NTTP int wow(T ts); int main() { retur

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-04 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Just get back to this again. So, I have explored the other case and found it particular to explicit template arguments. In fact, we could slightly revise the motivating case to ```cpp template concept C = false; template typename T> int wow(T ts); template struct S {}; int

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-04 Thread Younan Zhang via cfe-commits
@@ -345,15 +345,19 @@ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( using namespace TemplateInstArgsHelpers; const Decl *CurDecl = ND; + + if (!ND) zyn0217 wrote: > Can we also get a comment here why this makes sense to call > `Dec

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/76811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/76811 >From 1164c705a8515d39bc9d4404e8523da8876d81cf Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 3 Jan 2024 19:33:01 +0800 Subject: [PATCH 1/2] [Clang] Correctly construct template arguments for file-scope

[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/76811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/76811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/76811 >From 1164c705a8515d39bc9d4404e8523da8876d81cf Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 3 Jan 2024 19:33:01 +0800 Subject: [PATCH 1/3] [Clang] Correctly construct template arguments for file-scope

[clang] [Clang] Correctly construct template arguments for template template parameters (PR #76811)

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/76811 >From 1164c705a8515d39bc9d4404e8523da8876d81cf Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 3 Jan 2024 19:33:01 +0800 Subject: [PATCH 1/3] [Clang] Correctly construct template arguments for file-scope

[clang] [clang] Correctly implement CWG 2672 (PR #75001)

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/75001 >From 8681b3c9f5e19b6ae977321d5d4154113273c2a0 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 12 Nov 2023 13:21:03 +0800 Subject: [PATCH 1/2] [clang] Correctly implement CWG 2672 This is a follow-up patc

[clang] [clang] Correctly implement CWG 2672 (PR #75001)

2024-01-05 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thank you folks! https://github.com/llvm/llvm-project/pull/75001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   10   >