[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/8] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

2024-06-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/94889 >From 217c00f47aaa65b113d1c1cfd93a9c4e1d235c1a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 9 Jun 2024 11:49:18 +0800 Subject: [PATCH 1/8] [Clang] Fix two issues of CTAD for aggregates --- clang/lib/S

[clang] [Clang] Fix handling of brace ellison when building deduction guides (PR #94889)

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

[clang] Revert "[clang][NFC] Add a test for CWG2685" (PR #95389)

2024-06-13 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/95389 I was wrong: The purpose of CWG2685 is to avoid brace elision on string literals and we should be rejecting the case. Reverts llvm/llvm-project#95206 >From 0e8c9bca863137f14aea2cee0e05d4270b33e0e8 Mon Sep 17 0

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-15 Thread Younan Zhang via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

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

[clang] [clang] SourceLocIdentKind::Function should not be dependent (PR #94942)

2024-06-15 Thread Younan Zhang via cfe-commits
zyn0217 wrote: nit: Please rephrase the commit message before you merge this patch. A large piece of AST involving memory addresses is really hard to decipher. In addition, it would be nice if you can simplify the test case further - it's super unclear why a bunch of templates are there outsid

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

2024-06-15 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/95660 We had a code path in `Sema::MarkFunctionReferenced()` that deferred local lambda instantiation even for constexprs. This resulted in any calls to them referring to function decls that lack bodies and hence fail

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-15 Thread Younan Zhang via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

2024-06-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/95660 >From c288190c313d6990580048368c60a846919f98ae Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 15 Jun 2024 20:29:24 +0800 Subject: [PATCH 1/2] [Clang] Instantiate local constexpr functions eagerly --- cl

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

2024-06-16 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the review! I will commit when CI turns green. https://github.com/llvm/llvm-project/pull/95660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

2024-06-16 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Linux CI failed with an unrelated error. ``` TIMEOUT: lldb-api :: functionalities/fork/concurrent_vfork/TestConcurrentVFork.py (87750 of 87750)   | TEST 'lldb-api :: functionalities/fork/concurrent_vfork/TestConcurrentVFork.py' FAILED ``

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 01/15] [clangd] Support go-to-definition on type hints. The core p

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-16 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @HighCommander4 Sorry for my delay. This is ready for the next round of review, and I'm prepared for a lot of feedback! https://github.com/llvm/llvm-project/pull/86629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 01/16] [clangd] Support go-to-definition on type hints. The core p

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

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

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -15,9 +15,12 @@ #include "support/Context.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/ScopedPrinter.h" +#include "llvm/Support/raw_ostream.h" #include "gmock/gmock.h" #include "gtest/gtest.h" +#include #include +#include zyn0217 wrote: W

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: My two cents: While I appreciate the value of inspecting more semantic information about lambdas, I still have mixed feelings about user experience. Admittedly, presenting implicitly captured variables provides users with insight into ODR-used variables,

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -755,12 +807,34 @@ class InlayHintVisitor : public RecursiveASTVisitor { bool NameHint = shouldHintName(Args[I], Name); bool ReferenceHint = shouldHintReference(Params[I], ForwardedParams[I]); + bool IsDefault = isa(Args[I]); + HasNonDefaultArgs |= !I

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -372,6 +382,34 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) { + if (Capture.capturesVariable()) +return Capture.getCapturedVar()->getName(); + if (Capture.capturesThis

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -1568,7 +1626,7 @@ TEST(TypeHints, SubstTemplateParameterAliases) { )cpp"; llvm::StringRef VectorIntPtr = R"cpp( -vector array; +vector $init[[array]]; zyn0217 wrote: Will the range ever be used somewhere? https://github.com/llvm/llvm-project/

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -504,10 +503,10 @@ struct FragmentCompiler { auto Fast = isFastTidyCheck(Str); if (!Fast.has_value()) { diag(Warning, - llvm::formatv( - "Latency of clang-tidy check '{0}' is not known. " - "It will only run if

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -281,7 +281,7 @@ struct TextDocumentEdit { /// The text document to change. VersionedTextDocumentIdentifier textDocument; - /// The edits to be applied. + /// The edits to be applied. zyn0217 wrote: Ditto. Unrelated blank changes. Please revert

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -1458,13 +1463,66 @@ TEST(TypeHints, DefaultTemplateArgs) { struct A {}; A foo(); auto $var[[var]] = foo(); -A bar[1]; +A baz; +A bar[1]{}; zyn0217 wrote: Why there's an empty initializer? Can you revert it? https://github.com/llvm/

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Younan Zhang via cfe-commits
@@ -372,6 +382,34 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) { + if (Capture.capturesVariable()) +return Capture.getCapturedVar()->getName(); + if (Capture.capturesThis

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-17 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > To clarify, you mean hovering over the default capture '=' or '&' right? Yep, that's what I thought. > I'm happy to remove the lambdas from this PR in favor of the hover approach. No worries, but let's wait for other reviewers' opinions before we move forward. :) https://git

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the prompt and insightful feedback; I really appreciate it! There are a lot of comments, so it takes some time to digest them. I'll make an effort to address them in the coming days. https://github.com/llvm/llvm-project/pull/86629 _

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Younan Zhang via cfe-commits
@@ -1637,6 +1678,168 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Younan Zhang via cfe-commits
@@ -1637,6 +1678,168 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Younan Zhang via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-18 Thread Younan Zhang via cfe-commits
@@ -372,6 +374,292 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +class TypeInlayHintLabelPartBuilder +: public TypeVisitor { + QualType CurrentType; + NestedNameSpecifier *CurrentNestedNameSpecifier; + ASTContext &Context; + StringRef M

[clang] [Clang] Clarify diagnostic notes for implcitly generated deduction guides (PR #96084)

2024-06-19 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/96084 Given the following invalid code, ```cpp template struct S { T *a; }; S s = {1}; ``` we produce such diagnostics currently: ``` :2:8: note: candidate template ignored: could not match 'S' against 'int' 2 |

[clang] [Clang] Clarify diagnostic notes for implcitly generated deduction guides (PR #96084)

2024-06-19 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (A screenshot that helps to understand the changes here) ![ctad](https://github.com/llvm/llvm-project/assets/117258288/09d3d4b0-307b-4d8e-ae85-5f13734a2d07) (compared to what we have now and what GCC gives: https://godbolt.org/z/948M7x7fE) https://github.com/llvm/llvm-project/pu

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

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

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-20 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > C++ error messages already have a reputation of being rather long; I’m > candidly doubtful as to whether this would help most users too much... I think this is more about making us more accurate when we want to point out there's something wrong with users' code. Admittedly, it

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-20 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks @Sirraide for the review! I'd like to wait a couple of days before landing given that some folks are out for a wg21 meeting in these two weeks - in case they have other opinions. https://github.com/llvm/llvm-project/pull/96084 _

[clang] [Clang] resolve record declaration of defaulted comparison method by using the first argument (PR #96228)

2024-06-20 Thread Younan Zhang via cfe-commits
@@ -9192,7 +9194,7 @@ ComputeDefaultedComparisonExceptionSpec(Sema &S, SourceLocation Loc, EnterExpressionEvaluationContext Context( S, Sema::ExpressionEvaluationContext::Unevaluated); -CXXRecordDecl *RD = cast(FD->getLexicalParent()); +auto RD = getRecord

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/2] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/3] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/96084 >From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 19 Jun 2024 23:25:13 +0800 Subject: [PATCH 1/3] [Clang] Add diagnostic notes for implcitly generated deductio

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-21 Thread Younan Zhang via cfe-commits
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand, return; } + // If this is an implicit deduction guide against an implicitly defined + // constructor, add a note for it. Neither these deduction guides nor their + // corresp

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-21 Thread Younan Zhang via cfe-commits
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand, return; } + // If this is an implicit deduction guide against an implicitly defined + // constructor, add a note for it. Neither these deduction guides nor their + // corresp

[clang] [Clang][Sema] Use StructuralValues to model dependent NTTP arguments (PR #93556)

2024-05-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/93556 This patch takes Richard's approach of no longer modeling dependent NTTP arguments with TemplateParamObjectDecls. Clang used to do so, which left behind a problem in that we might mess up dependent and non-depen

[clang] [Clang][Sema] Use StructuralValues to model dependent NTTP arguments (PR #93556)

2024-05-28 Thread Younan Zhang via cfe-commits
@@ -221,8 +221,13 @@ static const ValueDecl *getAsSimpleValueDeclRef(const ASTContext &Ctx, // We model class non-type template parameters as their template parameter // object declaration. - if (V.isStruct() || V.isUnion()) + if (V.isStruct() || V.isUnion()) { +//

[clang] [Clang][Sema] Use StructuralValues to model dependent NTTP arguments (PR #93556)

2024-05-28 Thread Younan Zhang via cfe-commits
zyn0217 wrote: Thanks for the review. I'm also waiting for @mizvekov in case he has some opinions. https://github.com/llvm/llvm-project/pull/93556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [Clang][Sema] Use StructuralValues to model dependent NTTP arguments (PR #93556)

2024-05-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93556 >From 76639804b9e5391169e76c5b07650c11d64003de Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 28 May 2024 22:11:25 +0800 Subject: [PATCH] [Clang][Sema] Use StructuralValues to model dependent NTTP argume

[clang] [Clang][Sema] Use StructuralValues to model dependent NTTP arguments (PR #93556)

2024-05-28 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93556 >From 76639804b9e5391169e76c5b07650c11d64003de Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Tue, 28 May 2024 22:11:25 +0800 Subject: [PATCH 1/2] [Clang][Sema] Use StructuralValues to model dependent NTTP ar

[clang] [Clang][Sema] Use StructuralValues to model dependent NTTP arguments (PR #93556)

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

[clang] Use cast_or_null instead of cast (PR #93749)

2024-05-29 Thread Younan Zhang via cfe-commits
@@ -2408,9 +2408,11 @@ Expr *VarDecl::getInit() { return cast(S); auto *Eval = getEvaluatedStmt(); - return cast(Eval->Value.isOffset() -? Eval->Value.get(getASTContext().getExternalSource()) -: Eval->Value.get(nullptr));

[clang] [Clang] Fix overloading for constrained variadic functions (PR #93817)

2024-05-30 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. 😂Thanks! https://github.com/llvm/llvm-project/pull/93817 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Push an evaluation context for type constraints (PR #93945)

2024-05-31 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/93945 This helps getTemplateInstantiationArgs to properly recover template arguments of an enclosing concept Decl. Fixes https://github.com/llvm/llvm-project/issues/93821 >From 088c4199dd37172a57d965fe1b22f782084e127

[clang] [Clang][Sema] Push an evaluation context for type constraints (PR #93945)

2024-05-31 Thread Younan Zhang via cfe-commits
@@ -5004,6 +5004,20 @@ static bool CheckDeducedPlaceholderConstraints(Sema &S, const AutoType &Type, return true; MultiLevelTemplateArgumentList MLTAL(Concept, CanonicalConverted, /*Final=*/false); + // Build up an EvaluationContex

[clang] [Clang][Sema] Push an evaluation context for type constraints (PR #93945)

2024-05-31 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93945 >From 088c4199dd37172a57d965fe1b22f782084e127e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 31 May 2024 18:15:54 +0800 Subject: [PATCH 1/2] [Clang][Sema] Push an evaluation context for type constraints

[clang] [Clang][Sema] Push an evaluation context for type constraints (PR #93945)

2024-05-31 Thread Younan Zhang via cfe-commits
@@ -5004,6 +5004,20 @@ static bool CheckDeducedPlaceholderConstraints(Sema &S, const AutoType &Type, return true; MultiLevelTemplateArgumentList MLTAL(Concept, CanonicalConverted, /*Final=*/false); + // Build up an EvaluationContex

[clang] [Clang][Sema] Push an evaluation context for type constraints (PR #93945)

2024-06-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93945 >From 088c4199dd37172a57d965fe1b22f782084e127e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Fri, 31 May 2024 18:15:54 +0800 Subject: [PATCH 1/2] [Clang][Sema] Push an evaluation context for type constraints

[clang] [Clang][Sema] Push an evaluation context for type constraints (PR #93945)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-01 Thread Younan Zhang via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 01/11] [clangd] Support go-to-definition on type hints. The core p

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-01 Thread Younan Zhang via cfe-commits
@@ -1637,6 +1678,144 @@ TEST(TypeHints, SubstTemplateParameterAliases) { ExpectedHint{": static_vector", "vector_name"}); } +template +void assertTypeLinkHints(StringRef Code, StringRef HintRange, + Labels... ExpectedLabels) { +

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

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

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 01/13] [clangd] Support go-to-definition on type hints. The core p

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-06-01 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/86629 >From b8a69cbd9e0ee0aa35b38b7e3a78048cbe61447e Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 16 Mar 2024 23:30:10 +0800 Subject: [PATCH 01/14] [clangd] Support go-to-definition on type hints. The core p

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-06-03 Thread Younan Zhang via cfe-commits
@@ -1576,7 +1576,10 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( TrailingReturnTypeLoc, &DS), std::move(Attributes), DeclEndLoc); -Actions.ActOnLambdaClosureQualifiers(Intro, MutableLoc); +// We have called ActOnLa

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-06-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93206 >From 658e9d46adf6dd79aa6aef03a1817444a880348a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 23 May 2024 22:35:11 +0800 Subject: [PATCH 1/3] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambda

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-06-03 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @cor3ntin I have reduced the test cases (removed duplicate ones) and hopefully they look better. Can you please take another look? thanks! https://github.com/llvm/llvm-project/pull/93206 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

2024-06-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93206 >From 658e9d46adf6dd79aa6aef03a1817444a880348a Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Thu, 23 May 2024 22:35:11 +0800 Subject: [PATCH 1/3] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambda

[clang] [clang] fix parsing typeid with pack index (PR #94299)

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

[clang] [clang] fix parsing typeid with pack index (PR #94299)

2024-06-03 Thread Younan Zhang via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -std=c++2c -fsyntax-only -verify %s +// expected-no-diagnostics + +namespace std { +struct type_info { + const char *name; +}; +} // namespace std + +namespace GH93650_bug { +auto func(auto... inputArgs) { return typeid(inputArgs...[0]); } +}

[clang] [clang] fix parsing typeid with pack index (PR #94299)

2024-06-03 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. Thanks! LG with a nit. And please wait for @cor3ntin for the last approval. https://github.com/llvm/llvm-project/pull/94299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-16 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/89019 None >From e510a76d231de0e22ba52584a80f18deb6af91c6 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH] [clang] Distinguish unresolved templates in UnresolvedLooku

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH] [clang] Distinguish unresolved templates in UnresolvedLookupExpr

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; + +st

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
zyn0217 wrote: The pre-commit CI is still clogging after a few hours, and I'm opening it for feedback anyway. https://github.com/llvm/llvm-project/pull/89019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

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

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/2] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/3] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; + +st

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-17 Thread Younan Zhang via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; + +st

[clang-tools-extra] [clangd] Support go-to-definition on type hints. The core part (PR #86629)

2024-04-17 Thread Younan Zhang via cfe-commits
zyn0217 wrote: @HighCommander4 Any chance to have a try on this patch? I'm looking forward to the feedback, thanks! https://github.com/llvm/llvm-project/pull/86629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 created https://github.com/llvm/llvm-project/pull/89494 Since [6163aa9](https://github.com/llvm/llvm-project/commit/6163aa96799cbad7f2f58e02c5bebee9647056a5#diff-3a7ef0bff7d2b73b4100de636f09ea68b72eda191b39c8091a6a1765d917c1a2), we have introduced an optimization tha

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-20 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89494 >From ba2e2a4bd2f7442003d6aa21f3d848cfef5061f6 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 20 Apr 2024 02:52:16 +0800 Subject: [PATCH] [Clang][Parser] Don't always destroy template annotations at the

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

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

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-21 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > Are there actually any benefit from being that eager to delete template > annotations? Well, I don't have much context of that patch, but I think that makes sense in part e.g. When we have a function that involves many generic lambdas, where we would destroy template annotati

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

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

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Younan Zhang via cfe-commits
@@ -474,6 +477,17 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); D != DEnd; ++D) { +// Print enum members and public struct fields when +// PrintTagTypeCont

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Younan Zhang via cfe-commits
@@ -474,6 +477,17 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end(); D != DEnd; ++D) { +// Print enum members and public struct fields when +// PrintTagTypeCont

[clang] [clang-tools-extra] [clangd] Show struct fields and enum members in hovers (PR #89557)

2024-04-21 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thank you! I have a few questions: 1) Do we want an RFC in discourse for the changes in `DeclPrinter`? 2) Do you think we should also add some test cases to `DeclPrinterTest.cpp`? https://github.com/llvm/llvm-project/pull/89557 __

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-22 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > If we remove MaybeDestroyTemplateIds(); in ParseStatementOrDeclaration, does > it fix the bug, and does it actually impact performance? It fixes the bug; however, I'm afraid we would also lose the chance to optimize the following: ```cpp void foo() { auto generic = []() {};

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-22 Thread Younan Zhang via cfe-commits
@@ -186,3 +186,74 @@ class E { #endif template using D = int; // expected-note {{declared here}} E ed; // expected-note {{instantiation of}} + +namespace non_functions { + +#if __cplusplus >= 201103L +namespace PR88832 { +template struct O { + static const T v = 0; +}; + +st

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/4] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-04-22 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89019 >From 89a5bbcc89c1e43ac7f2e60f3c234c2c42928c86 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Wed, 17 Apr 2024 12:24:56 +0800 Subject: [PATCH 1/5] [clang] Distinguish unresolved templates in UnresolvedLookupE

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-22 Thread Younan Zhang via cfe-commits
zyn0217 wrote: > One question I have is whether it would make sense to modify > DestroyTemplateIdAnnotationsRAIIObj to not call MaybeDestroyTemplateIds() in > the first place I’d love to try if it were feasible, but please note that the annotation was deleted by a direct call to MaybeDestroyT

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89494 >From ba2e2a4bd2f7442003d6aa21f3d848cfef5061f6 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 20 Apr 2024 02:52:16 +0800 Subject: [PATCH] [Clang][Parser] Don't always destroy template annotations at the

[clang] [Clang][Parser] Don't always destroy template annotations at the end of a declaration (PR #89494)

2024-04-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/89494 >From 3d5d4d973b9a76d9a07cdd6b89b304e2c7f37308 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sat, 20 Apr 2024 02:52:16 +0800 Subject: [PATCH] [Clang][Parser] Don't always destroy template annotations at the

<    1   2   3   4   5   6   7   8   9   10   >