[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 = [] {

[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

[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] [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.

[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

[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] 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`.

[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

[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

[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 ) { if (Loc.isFileID()) return true; auto Spelling = SM.getDecomposedSpellingLoc(Loc); - StringRef SpellingFile = SM.getSLocEntry(Spelling.first).getFile().getName(); + bool

[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 ) { if (Loc.isFileID()) return true; auto Spelling = SM.getDecomposedSpellingLoc(Loc); - StringRef SpellingFile = SM.getSLocEntry(Spelling.first).getFile().getName(); + bool

[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

[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

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

[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 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 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 {};

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

[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

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

2024-01-05 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed 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] [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

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

2024-01-05 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thank you for the feedback. > I wouldn't be surprised if it is now being used in situations where the > decl-context hasn't been appropriately updated I think this is not the case where we’re dealing with ill-formed Decl-contexts; it is that the caller site doesn't respect the

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

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

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

2024-01-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed 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-06 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/76811 >From e017bed2ee443d72f445f584dd6356bf151c5d79 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-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2024-01-10 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-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2024-01-10 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (I'll land it once the CI turns green.) 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-tools-extra] [clangd] Handle lambda scopes inside Node::getDeclContext() (PR #76329)

2024-01-11 Thread Younan Zhang via cfe-commits
zyn0217 wrote: The CI failure on windows seems irrelevant, so I'm landing it anyway. ``` FAILED: tools/clang/tools/extra/clangd/CompletionModel.h tools/clang/tools/extra/clangd/CompletionModel.cpp cmd.exe /C "cd /D C:\ws\src\build\tools\clang\tools\extra\clangd && C:\Python39\python.exe

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

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

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

2024-01-10 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Sorry for being silent for a few days, I've been a bit occupied recently and hopefully I could get back to the heuristic patch for templates soon. > I went through the existing callers of Node::getDeclContext(), and I was able > to construct a test case where the patch actually

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

2024-01-11 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed 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][Sema] Extract ellipsis location from CXXFoldExpr for reattaching constraints on NTTPs (PR #78080)

2024-01-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/78080 We build up a `CXXFoldExpr` for immediately declared constraints as per C++20 [temp.param]/4. This is done by `formImmediatelyDeclaredConstraint` where an `EllipsisLoc` is essential to determine whether this is

[clang] [Clang][Sema] Extract ellipsis location from CXXFoldExpr for reattaching constraints on NTTPs (PR #78080)

2024-01-14 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/78080 >From 7c0b5ffe4b377f198308b976eb726138837145c4 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 14 Jan 2024 12:21:33 +0800 Subject: [PATCH 1/2] [Clang][Sema] Extract ellipsis location from CXXFoldExpr for

[clang-tools-extra] [clangd] Don't collect templated decls for builtin templates (PR #78466)

2024-01-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/78466 Builtin templates e.g. `__make_integer_seq`, `__type_pack_element` are such that they don't have alias *Decls*. [D133262](https://reviews.llvm.org/D133262) marked these as alias templates, resulting in an

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-01-18 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I think this also fixes https://github.com/llvm/llvm-project/issues/63845 and the example in https://github.com/llvm/llvm-project/issues/41751#issuecomment-1696389046. https://github.com/llvm/llvm-project/pull/78598 ___ cfe-commits

[clang-tools-extra] [clangd] Don't collect templated decls for builtin templates (PR #78466)

2024-01-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/78466 >From efa5098e9ca433654ef3bc439c422867e4abee41 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 18 Jan 2024 00:15:18 +0800 Subject: [PATCH 1/2] [clangd] Don't collect templated decls for builtin templates

[clang-tools-extra] [clangd] Don't collect templated decls for builtin templates (PR #78466)

2024-01-18 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 closed https://github.com/llvm/llvm-project/pull/78466 ___ 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-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 template template parameters (PR #76811)

2024-01-05 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > That TTPD eventually DOES get the correct decl context, right? Or have you > found a case where the decl context is NEVER set right? 1) I believe so, yes; 2) Not yet, but I would keep an eye on issues. So I presume the removal for declcontexts is correct (at least) at the

[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() {

[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

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

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

[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

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

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

[clang] [concepts] Set up an instantiation scope for constraint expression comparison (PR #79698)

2024-01-27 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/79698 This is a follow-up for the comparison of constraints on out-of-line function template definitions. We require the instantiation of a ParmVarDecl while transforming the expression if that Decl gets referenced

[clang] [concepts] Set up an instantiation scope for constraint expression comparison (PR #79698)

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

[clang] [clang-tools-extra] [llvm] [Concepts] Traverse the instantiation chain for parameter injection inside a constraint scope (PR #79568)

2024-01-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/79568 >From 386c17d55f68155b711672f87d803eb934372a70 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Jan 2024 18:03:37 +0800 Subject: [PATCH 1/2] [Concepts] Traverse the instantiation chain for parameter

[llvm] [clang] [clang-tools-extra] [Concepts] Traverse the instantiation chain for parameter injection inside a constraint scope (PR #79568)

2024-01-26 Thread Younan Zhang via cfe-commits
zyn0217 wrote: The failing libcxx test `libcxx/gdb/gdb_pretty_printer_test.sh.cpp` doesn't appear to relate to this patch, so I'm landing it anyway. https://github.com/llvm/llvm-project/pull/79568 ___ cfe-commits mailing list

[llvm] [clang] [clang-tools-extra] [Concepts] Traverse the instantiation chain for parameter injection inside a constraint scope (PR #79568)

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

[clang] [clang-tools-extra] [Clang][Sema] fix deducing auto& from const int in template parameters is impossible in partial specializations (PR #79733)

2024-01-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/79733 >From 9834d065580a668f94f74adaf8507ca672e9118f Mon Sep 17 00:00:00 2001 From: huqizhi Date: Sun, 28 Jan 2024 15:12:01 +0800 Subject: [PATCH] [Clang][Sema] fix deducing auto& from const int in template

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

2024-01-28 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (A drive-by comment: I stumbled on the commit message of this PR and found it surprising that I'm the co-author of it! I'm not entirely clear on GitHub's schemas, but IMO shouldn't the co-author be the one who clicks the "merge" button?)

[clang] [clang][Sema] GH58548 (PR #80395)

2024-02-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/80395 Draft for triggering the libc++ CI. >From 24a8251aab9a1a03953412ae47508d039d926212 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 2 Feb 2024 15:24:13 +0800 Subject: [PATCH] [clang][Sema] Fix GH58548

[clang] [libc] [flang] [clang-tools-extra] [llvm] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

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

[clang-tools-extra] [clang] [flang] [libc] [llvm] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

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

[clang] [clang][Sema] GH58548 (PR #80395)

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

[clang] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate. (PR #80395)

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

[llvm] [flang] [libc] [clang] [clang-tools-extra] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

2024-02-02 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the quick review! I tested the original bug report without the patch but couldn't reproduce it. Nevertheless, the example produced by @royjacobson (which still crashes the trunk) was fixed by this patch. I'm not sure if this merits a backport?

[flang] [libc] [clang-tools-extra] [clang] [llvm] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

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

[llvm] [flang] [libc] [clang] [clang-tools-extra] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

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

[flang] [libc] [clang-tools-extra] [clang] [llvm] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

2024-02-02 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/80395 >From 24a8251aab9a1a03953412ae47508d039d926212 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 2 Feb 2024 15:24:13 +0800 Subject: [PATCH 1/2] [clang][Sema] Fix GH58548 --- clang/docs/ReleaseNotes.rst

[clang] [clang][Sema] GH58548 (PR #80395)

2024-02-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/80395 >From 24a8251aab9a1a03953412ae47508d039d926212 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 2 Feb 2024 15:24:13 +0800 Subject: [PATCH 1/2] [clang][Sema] Fix GH58548 --- clang/docs/ReleaseNotes.rst

[clang] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

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

[clang] [clang][Sema] Populate function template depth at AddTemplateOverloadCandidate (PR #80395)

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

[clang-tools-extra] [clangd] Implement simple folding of preprocessor branches (PR #80592)

2024-02-04 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Note that clang-pseudo is deprecated and will soon get [removed](https://github.com/llvm/llvm-project/pull/80081) from the repository. I have no idea about the replacement, and I'm not sure if it makes sense to evolve the feature with it. I invited some folks (who may be in

[clang-tools-extra] [clang] [llvm] [concepts] Extract function template pack arguments from the current instantiation if possible (PR #80594)

2024-02-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/80594 >From c04bb951d35e0f767ea9b0fed8e200b161d646e1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 4 Feb 2024 17:35:16 +0800 Subject: [PATCH 1/2] [concepts] Fixes for gh72557 --- clang/docs/ReleaseNotes.rst

[clang-tools-extra] [clang] [llvm] [concepts] Extract function template pack arguments from the current instantiation if possible (PR #80594)

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

[clang] [concepts] Fixes for gh72557 (PR #80594)

2024-02-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/80594 Draft for CI. >From c04bb951d35e0f767ea9b0fed8e200b161d646e1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 4 Feb 2024 17:35:16 +0800 Subject: [PATCH] [concepts] Fixes for gh72557 ---

[clang] [concepts] Fixes for gh72557 (PR #80594)

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

[clang] [concepts] Extract function template pack arguments from the current instantiation if possible (PR #80594)

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

[clang] [concepts] Extract function template pack arguments from the current instantiation if possible (PR #80594)

2024-02-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/80594 >From c04bb951d35e0f767ea9b0fed8e200b161d646e1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 4 Feb 2024 17:35:16 +0800 Subject: [PATCH 1/2] [concepts] Fixes for gh72557 --- clang/docs/ReleaseNotes.rst

[clang-tools-extra] [clang] [llvm] [concepts] Extract function template pack arguments from the current instantiation if possible (PR #80594)

2024-02-04 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/80594 >From c04bb951d35e0f767ea9b0fed8e200b161d646e1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 4 Feb 2024 17:35:16 +0800 Subject: [PATCH 1/3] [concepts] Fixes for gh72557 --- clang/docs/ReleaseNotes.rst

[libc] [libcxxabi] [lld] [clang-tools-extra] [llvm] [mlir] [flang] [lldb] [libunwind] [clang] [compiler-rt] [openmp] [libcxx] [clang] static operators should evaluate object argument (PR #68485)

2024-01-30 Thread Younan Zhang via cfe-commits
@@ -15097,15 +15102,9 @@ ExprResult Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc, ExprValueKind VK = Expr::getValueKindForType(ResultTy); ResultTy = ResultTy.getNonLValueExprType(Context); -CallExpr *TheCall; -if

[llvm] [lldb] [lld] [libcxx] [clang-tools-extra] [libcxxabi] [libc] [clang] [libunwind] [openmp] [compiler-rt] [flang] [mlir] [clang] static operators should evaluate object argument (PR #68485)

2024-01-30 Thread Younan Zhang via cfe-commits
@@ -15097,15 +15102,9 @@ ExprResult Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc, ExprValueKind VK = Expr::getValueKindForType(ResultTy); ResultTy = ResultTy.getNonLValueExprType(Context); -CallExpr *TheCall; -if

[libc] [libcxx] [lldb] [flang] [compiler-rt] [clang-tools-extra] [llvm] [lld] [clang] [concepts] Push a CurContext before substituting into out-of-line constraints for comparison (PR #79985)

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

[lld] [lldb] [libunwind] [mlir] [libcxx] [llvm] [openmp] [libc] [compiler-rt] [flang] [clang-tools-extra] [libcxxabi] [clang] [clang] static operators should evaluate object argument (PR #68485)

2024-01-30 Thread Younan Zhang via cfe-commits
@@ -15097,15 +15102,9 @@ ExprResult Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc, ExprValueKind VK = Expr::getValueKindForType(ResultTy); ResultTy = ResultTy.getNonLValueExprType(Context); -CallExpr *TheCall; -if

[openmp] [lld] [compiler-rt] [flang] [lldb] [libunwind] [libcxxabi] [llvm] [libcxx] [mlir] [clang-tools-extra] [clang] [libc] [clang] static operators should evaluate object argument (reland) (PR #801

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

[openmp] [lld] [compiler-rt] [flang] [lldb] [libunwind] [libcxxabi] [llvm] [libcxx] [mlir] [clang-tools-extra] [clang] [libc] [clang] static operators should evaluate object argument (reland) (PR #801

2024-01-30 Thread Younan Zhang via cfe-commits
@@ -651,16 +651,12 @@ class InlayHintVisitor : public RecursiveASTVisitor { // implied object argument ([over.call.func]), the list of provided // arguments is preceded by the implied object argument for the purposes of // this correspondence... -// -//

[openmp] [lld] [compiler-rt] [flang] [lldb] [libunwind] [libcxxabi] [llvm] [libcxx] [mlir] [clang-tools-extra] [clang] [libc] [clang] static operators should evaluate object argument (reland) (PR #801

2024-01-30 Thread Younan Zhang via cfe-commits
@@ -651,16 +651,12 @@ class InlayHintVisitor : public RecursiveASTVisitor { // implied object argument ([over.call.func]), the list of provided // arguments is preceded by the implied object argument for the purposes of // this correspondence... -// -//

[flang] [clang-tools-extra] [compiler-rt] [lldb] [libunwind] [libcxx] [lld] [mlir] [clang] [libc] [openmp] [llvm] [libcxxabi] [clang] static operators should evaluate object argument (reland) (PR #801

2024-01-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks again for working on it. The clangd part LGTM, and since the other part was left as-is and had been accepted in our previous attempt #68485, I believe we can now reland the patch. Please keep an eye on the CI in case we have missed

[llvm] [libcxx] [lld] [libc] [compiler-rt] [lldb] [clang] [clang-tools-extra] [flang] [concepts] Push a CurContext before substituting into out-of-line constraints for comparison (PR #79985)

2024-01-31 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I plan to backport this patch and #79698 to clang 18 a few days later to see if we're actually not breaking anything. https://github.com/llvm/llvm-project/pull/79985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [concepts] Set up an instantiation scope for constraint expression comparison (PR #79698)

2024-01-30 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I've seen `llvm-libc++-shared.cfg.in :: libcxx/gdb/gdb_pretty_printer_test.sh.cpp` was failing intermittently on CI recently, which turned out to be unrelated to Concepts. In case I missed anything, I've run the libcxx tests locally, which are all green. ```txt Testing Time:

[lld] [clang] [llvm] [lldb] [clang-tools-extra] [libc] [compiler-rt] [libcxx] [flang] [concepts] Push a CurContext before substituting into out-of-line constraints for comparison (PR #79985)

2024-01-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/79985 >From 7ee1874af426d7879d218c6b8852fca0a87b1836 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 30 Jan 2024 18:49:08 +0800 Subject: [PATCH] [concepts] Push a CurContext before substituting into

[lld] [flang] [clang] [clang-tools-extra] [libc] [libcxx] [llvm] [lldb] [compiler-rt] [concepts] Set up an instantiation scope for constraint expression comparison (PR #79698)

2024-01-30 Thread Younan Zhang via cfe-commits
zyn0217 wrote: I'll try the CI again before landing it. https://github.com/llvm/llvm-project/pull/79698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [concepts] Push a CurContext before substituting into out-of-line constraints for comparison (PR #79985)

2024-01-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/79985 `InjectedClassNameType` is such that every template specialization within the Record scope ought to canonicalize to it, as outlined above the definition of that Type. This invariant is maintained during the

[lld] [clang] [llvm] [lldb] [clang-tools-extra] [libc] [compiler-rt] [libcxx] [flang] [concepts] Set up an instantiation scope for constraint expression comparison (PR #79698)

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

[clang] [WIP] Try to fix GH73418 (PR #79568)

2024-01-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/79568 For the purpose of poking the libc++ CI. >From 212a4efbc65c437f652dc08c75ed4a836167fe70 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Jan 2024 18:03:37 +0800 Subject: [PATCH] [clang][Sema] fixup

[clang] [WIP] Try to fix GH73418 (PR #79568)

2024-01-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/79568 >From 386c17d55f68155b711672f87d803eb934372a70 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 26 Jan 2024 18:03:37 +0800 Subject: [PATCH] [Concepts] Traverse the instantiation chain for parameter

<    1   2   3   4   5   6   >