[clang] [clang] Refactor target attribute mangling. (PR #81893)

2024-02-28 Thread Erich Keane via cfe-commits
@@ -857,6 +864,36 @@ void AArch64TargetCodeGenInfo::checkFunctionCallABI( << Callee->getDeclName(); } +void AArch64ABIInfo::appendAttributeMangling(TargetClonesAttr *Attr, + unsigned Index, +

[clang] [clang] Refactor target attribute mangling. (PR #81893)

2024-02-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/81893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?Message-ID: In-Reply-To: https://github.com/erichkeane commented: This needs tests plus a release note. Also, there is a lot of repeated code between the pre-c++20 and c++20 versions that will make this really hard to maintain, particularly with core issues,

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?Message-ID: In-Reply-To: @@ -5548,13 +5514,113 @@ static bool isAtLeastAsSpecializedAs(Sema &S, FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLocation Loc, TemplatePa

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?Message-ID: In-Reply-To: https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/83279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?Message-ID: In-Reply-To: @@ -5548,13 +5514,113 @@ static bool isAtLeastAsSpecializedAs(Sema &S, FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLocation Loc, TemplatePa

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?Message-ID: In-Reply-To: @@ -5333,11 +5333,31 @@ bool Sema::CheckIfFunctionSpecializationIsImmediate(FunctionDecl *FD, return false; } +static QualType GetImplicitObjectParameterTypeCXX20(ASTContext &Context, +

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?Message-ID: In-Reply-To: @@ -5333,11 +5333,31 @@ bool Sema::CheckIfFunctionSpecializationIsImmediate(FunctionDecl *FD, return false; } +static QualType GetImplicitObjectParameterTypeCXX20(ASTContext &Context, erichkeane wro

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-28 Thread Erich Keane via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/83279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?Istv=C3=A1n_Horv=C3=A1th?=,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/erichkeane commented: This is close I think, just needs tests + ReleaseNotes.rst entry. https://github.com/llvm/llvm-project/pull/83279 __

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -5548,13 +5504,100 @@ static bool isAtLeastAsSpecializedAs(Sema &S, FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLoc

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-28 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -5548,13 +5504,100 @@ static bool isAtLeastAsSpecializedAs(Sema &S, FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLoc

[clang] [OpenACC] Implement Compute Construct 'goto' in/out logic (PR #83326)

2024-02-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/83326 Compute Constructs do not permit jumping in/out of them, so this patch implements this for 'goto' as a followup to the other patches that have done the same thing. It does this by modifying the JumpDiagnosti

[clang] [OpenACC] Implement Compute Construct 'goto' in/out logic (PR #83326)

2024-02-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/83326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix NULL dereferences for invalid references (PR #77703)

2024-02-29 Thread Erich Keane via cfe-commits
erichkeane wrote: Yeah, this doesn't seem right to me. Info is a reference, and thus cannot be null by language rule. A sufficiently smart compiler will remove your check. If we're SOMEHOW (though I don't see how?) setting it to nullptr, we need to fix that as that is not intended, nor part

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-02-29 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -5548,13 +5504,100 @@ static bool isAtLeastAsSpecializedAs(Sema &S, FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLoc

[clang] [Concepts] Add Decls from the outer scope of the current lambda for conversion function constraints (PR #83420)

2024-02-29 Thread Erich Keane via cfe-commits
@@ -7976,7 +7976,8 @@ void Sema::AddConversionCandidate( if (Conversion->getTrailingRequiresClause()) { ConstraintSatisfaction Satisfaction; -if (CheckFunctionConstraints(Conversion, Satisfaction) || +if (CheckFunctionConstraints(Conversion, Satisfaction, /*Usage

[clang] [Concepts] Add Decls from the outer scope of the current lambda for conversion function constraints (PR #83420)

2024-02-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I think this looks good, but I want @cor3ntin to do the final approval, he touched it last :) https://github.com/llvm/llvm-project/pull/83420 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [OpenACC] Implement Duffs-Device restriction for Compute Constructs (PR #83460)

2024-02-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/83460 Like the last few patches, branching in/out of a compute construct is not valid. This patch implements checking to ensure that a 'case' or 'default' statement cannot jump into a Compute Construct (in the sty

[clang] [OpenACC] Implement Duffs-Device restriction for Compute Constructs (PR #83460)

2024-02-29 Thread Erich Keane via cfe-commits
@@ -534,6 +534,25 @@ class Scope { return false; } + /// Determine if this scope (or its parents) are a compute construct inside of + /// the nearest 'switch' scope. This is needed to check whether we are inside + /// of a 'duffs' device, which is an illegal branch

[clang] Fix implementation of [temp.param]p14's first sentence. (PR #83487)

2024-02-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/83487 The first sentence says: If a template-parameter of a class template, variable template, or alias template has a default template-argument, each subsequent template-parameter shall either have a default temp

[clang] Fix implementation of [temp.param]p14's first sentence. (PR #83487)

2024-03-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > The changes look correct to me, but I think we should add a DR test for this > so that we can properly regenerate cxx_dr_status.html > > Also, the changes should come with a release note. Ooof, yeah, forgot the release note. @Endilll has volunteered to do the DR test in a

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-01 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -5548,13 +5504,100 @@ static bool isAtLeastAsSpecializedAs(Sema &S, FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplat

[clang] [OpenACC] Implement Duffs-Device restriction for Compute Constructs (PR #83460)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/83460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix implementation of [temp.param]p14's first sentence. (PR #83487)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/83487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix NULL dereferences for invalid references (PR #77703)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/77703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix NULL dereferences for invalid references (PR #77703)

2024-03-01 Thread Erich Keane via cfe-commits
erichkeane wrote: I spent a while debugging this, and this is far from the correct solution. However, in my debugging I was able to identify the correct solution, so I'll prepare a patch to fix this, closing. https://github.com/llvm/llvm-project/pull/77703

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/83611 This was reported (sort of) in a PR: #77703. The problem is that a declarator 'owns' an attributes allocation via an `AttributePool`. However, this example tries to copy a DeclaratorChunk from one Declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/2] Fix null-deref thanks to an attribute on a global declarator

[clang] [clang][parse] Fix UAF in MaybeDestroyTemplates (PR #77698)

2024-03-01 Thread Erich Keane via cfe-commits
erichkeane wrote: We do need a unit test for this, a reduced version of the original fuzzed result will help us review this. https://github.com/llvm/llvm-project/pull/77698 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [llvm] [Frontend] Add leaf constructs and association to OpenMP/ACC directives (PR #83625)

2024-03-01 Thread Erich Keane via cfe-commits
@@ -665,60 +619,44 @@ bool clang::isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind) { } bool clang::isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind) { - return DKind == OMPD_teams || DKind == OMPD_teams_distribute || - DKind == OMPD_teams_distr

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-02 Thread Erich Keane via cfe-commits
@@ -100,6 +100,12 @@ void AttributePool::takePool(AttributePool &pool) { pool.Attrs.clear(); } +void AttributePool::takeFrom(ParsedAttributesView &List, AttributePool &Pool) { + assert(&Pool != this && "AttributePool can't take attributes from itself"); + llvm::for_each(Li

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-02 Thread Erich Keane via cfe-commits
erichkeane wrote: Note to self when I get back to work: 1- Update commit message with bug #[ 83611](https://github.com/llvm/llvm-project/pull/83611) 2- Add bug # to release note. https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/3] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/3] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
erichkeane wrote: > Note to self when I get back to work: Both done now! https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/3] Fix null-deref thanks to an attribute on a global declarator

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/83611 >From 8152ad56b320719553701edf020c30aea8c3213e Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 1 Mar 2024 11:36:14 -0800 Subject: [PATCH 1/4] Fix null-deref thanks to an attribute on a global declarator

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-03-04 Thread Erich Keane via cfe-commits
erichkeane wrote: > @stbergmann is right. @erichkeane How should I proceed? Should I open a > revert PR? Or should I open a separate issue? For now, unless someone insists, I think we're likely fine to do a follow-up PR to fix that. Make sure to put the same reviewers on, and we'll see if we

[clang] [llvm] [Frontend] Add leaf constructs and association to OpenMP/ACC directives (PR #83625)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -665,60 +619,44 @@ bool clang::isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind) { } bool clang::isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind) { - return DKind == OMPD_teams || DKind == OMPD_teams_distribute || - DKind == OMPD_teams_distr

[clang] [clang] Add some CodeGen tests for CWG 4xx issues (PR #83715)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -0,0 +1,24 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexcept

[clang] [clang] Add some CodeGen tests for CWG 4xx issues (PR #83715)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexcept

[clang] [llvm] [Frontend] Add leaf constructs and association to OpenMP/ACC directives (PR #83625)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -665,60 +619,44 @@ bool clang::isOpenMPTargetDataManagementDirective(OpenMPDirectiveKind DKind) { } bool clang::isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind) { - return DKind == OMPD_teams || DKind == OMPD_teams_distribute || - DKind == OMPD_teams_distr

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-03-04 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Hi @AaronBallman Can you pls explain me your previous response _"It would > > be better for us to associate the data with catch statements specifically > > because there's a lot fewer of those than there are variable declarations > > in general."_ > > I mean storing the e

[clang] [clang] Add some CodeGen tests for CWG 4xx issues (PR #83715)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexcept

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Erich Keane via cfe-commits
erichkeane wrote: > Updated with new fix (still need a release note) Please update the patch message in github (which should allow editing) to reflect the new approach. https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This seems right to me, modulo the release note/updated commit message. https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add -Wmissing-designated-field-initializers (PR #81364)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -2363,8 +2356,11 @@ void InitListChecker::CheckStructUnionTypes( } // Emit warnings for missing struct field initializers. - if (!VerifyOnly && InitializedSomething && CheckForMissingFields && - !RD->isUnion()) { + // This check is disabled for designated initial

[clang] [clang] Add -Wmissing-designated-field-initializers (PR #81364)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -2363,8 +2356,11 @@ void InitListChecker::CheckStructUnionTypes( } // Emit warnings for missing struct field initializers. - if (!VerifyOnly && InitializedSomething && CheckForMissingFields && - !RD->isUnion()) { + // This check is disabled for designated initial

[clang] [clang] Add -Wmissing-designated-field-initializers (PR #81364)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -2363,8 +2356,11 @@ void InitListChecker::CheckStructUnionTypes( } // Emit warnings for missing struct field initializers. - if (!VerifyOnly && InitializedSomething && CheckForMissingFields && - !RD->isUnion()) { + // This check is disabled for designated initial

[clang] [clang] Add -Wmissing-designated-field-initializers (PR #81364)

2024-03-04 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/81364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-04 Thread Erich Keane via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-03-05 Thread Erich Keane via cfe-commits
@@ -12669,6 +12669,19 @@ TreeTransform::TransformCXXNewExpr(CXXNewExpr *E) { ArraySize = NewArraySize.get(); } + // Per C++0x [expr.new]p5, the type being constructed may be a + // typedef of an array type. erichkeane wrote: This comment doesn't real

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-05 Thread Erich Keane via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-05 Thread Erich Keane via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-05 Thread Erich Keane via cfe-commits
erichkeane wrote: > @cor3ntin, @erichkeane, thanks for all review comments. I'm not sure you have > reviewed the whole patch. My feeling is that the core part > (`DeclareImplicitDeductionGuidesForTypeAlias`) may not have received > sufficient reviews. It would be great if you can take a closer

[clang] [clang] Bugfix for choosing the more specialized overload (PR #83279)

2024-03-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Horváth?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: erichkeane wrote: Yeah, agree with @cor3ntin here. I don't think this needs the C++20 check

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

2024-01-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 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

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

2024-01-30 Thread Erich Keane via cfe-commits
erichkeane wrote: I have absolutely no idea how to fix it as I don't understand the syntax of the clangd tests, but it SEEMS like it is just a source-location type thing that is wrong? https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clangd/unittests/InlayHintTests.cpp#L810 >F

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Are there any release-notes that should be reverted with this? or at least modified, since this is reverting stuff? Also, can you please add the tests/regressions that were found that have lead to this partial revert? https://github.com/llvm/llvm-proj

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > @AaronBallman @zygoloid There probably is a missing ODR-use marking > somewhere, if you have a clue [#78041 > (comment)](https://github.com/llvm/llvm-project/pull/78041#issuecomment-1917571069) > > Alas we do not seem to have a repro for the chromium-reported issue which >

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-30 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I don't have concerns as written. @cor3ntin : feel free to accept if you like it too. https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] Revert "[Clang][Sema] fix outline member function template with defau… (PR #80144)

2024-01-31 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/80144 …lt align crash (#78400)" This reverts commit 7b3389980ddbd84f72ccc4776889c67519cc2c14. A regression was discovered here: https://github.com/llvm/llvm-project/pull/78400 and the author requested a revert to

[clang] Revert "[Clang][Sema] fix outline member function template with defau… (PR #80144)

2024-01-31 Thread Erich Keane via cfe-commits
erichkeane wrote: Sitting here for CI, will merge when it passes. https://github.com/llvm/llvm-project/pull/80144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] fix outline member function template with default align crash (PR #78400)

2024-01-31 Thread Erich Keane via cfe-commits
erichkeane wrote: > > @jcsxky this patch introduced a regression. Please see the reproducer here: > > https://godbolt.org/z/rEfWP75Ta. It compiles before this change and fails > > at this change. It also compiles with gcc and clang-17. > > Sorry for importing new bugs. @erichkeane Could you he

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] fix outline member function template with defau… (PR #80144)

2024-01-31 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/80144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Erich Keane via cfe-commits
erichkeane wrote: > Thanks! Should I open an issue to backport this to RC? Please do! https://github.com/llvm/llvm-project/pull/80050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Represent array refs as `TemplateArgument::Declaration` (PR #80050)

2024-01-31 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Please do! > > #80150. I don't know, maybe, some more actions should be done. I cannot add > "release:backport" label, at least. I think you just have to set hte milestone, which I did. https://github.com/llvm/llvm-project/pull/80050 _

[clang] [clang][FMV] Direct-call FMV callees from FMV callers (PR #80093)

2024-01-31 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: My immediate response is that this sounds like something that OPT should be doing here, not us. We typically do NOT do this sort of thing the CFE, and do not want to do opt-type stuff in the CFE. Is there good reason that this isn't a part of the inli

[clang] [clang][FMV] Direct-call FMV callees from FMV callers (PR #80093)

2024-01-31 Thread Erich Keane via cfe-commits
erichkeane wrote: > My gut feel was that recovering this information from the callee's resolver's > body would take heroics if we tried to do it in the backend. Opt can already see the feature strings in the llvm-attributes, and can introspect into it for the resolver. I could PERHAPS see val

[clang] [Clang][NFC] Remove TemplateArgumentList::OnStack (PR #79760)

2024-02-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane I added the following release note: > > > Removed support for constructing on-stack `TemplateArgumentList`s. > > Interfaces should instead use `ArrayRef` to pass template > > arguments. > > I'm not entirely sure how to benchmark these changes. Perhaps I could

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This needs a release note and some tests as well. https://github.com/llvm/llvm-project/pull/80040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/80040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-01 Thread Erich Keane via cfe-commits
@@ -8265,6 +8265,9 @@ def warn_condition_is_assignment : Warning<"using the result of an " def warn_free_nonheap_object : Warning<"attempt to call %0 on non-heap %select{object %2|object: block expression|object: lambda-to-function-pointer conversion}1">, InGroup; +def

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-01 Thread Erich Keane via cfe-commits
@@ -10098,6 +10098,23 @@ static bool isVector(QualType QT, QualType ElementType) { return false; } +bool Sema::IsPointerToPointer(QualType LHSType, QualType RHSType) { + if (const PointerType *LHSPointer = dyn_cast(LHSType)) { erichkeane wrote: I think th

[clang] [Clang][NFC] Remove TemplateArgumentList::OnStack (PR #79760)

2024-02-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane I ended up writing a python script that compiles the TUs in > `clang/lib` with `-print-stats` and then sums up the total bytes allocated by > `ASTContext`. Ended up with a 0.4% decrease in memory usage. > > This does however rely on `compile_commands.json`, and

[clang] [Clang][Parse] Diagnose member template declarations with multiple declarators (PR #78243)

2024-02-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this looks fine now... WDYT @cor3ntin ? https://github.com/llvm/llvm-project/pull/78243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [Clang][NFC] Remove TemplateArgumentList::OnStack (PR #79760)

2024-02-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane How does this sound? > > > Removed support for constructing on-stack `TemplateArgumentList`s; > > interfaces should instead use `ArrayRef` to pass template > > arguments. Transitioning internal uses to `ArrayRef` > > reduces AST memory usage by 0.4% when compil

[clang] [Clang][NFC] Remove TemplateArgumentList::OnStack (PR #79760)

2024-02-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/79760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

2024-02-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm not the best reviewer for this, but it looks reasonable to me. Perhaps Aaron should take a look to make sure? https://github.com/llvm/llvm-project/pull/80327 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [clang] Add some CodeGen tests for CWG 1xx issues (PR #80338)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This looks right to me. https://github.com/llvm/llvm-project/pull/80338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Other than release note, this LGTM. https://github.com/llvm/llvm-project/pull/80359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] fix outline member function template with default align crash (PR #80288)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/80288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [attributes][analyzer] Generalize [[clang::suppress]] to declarations. (PR #80371)

2024-02-02 Thread Erich Keane via cfe-commits
@@ -147,6 +147,20 @@ bool BugSuppression::isSuppressed(const PathDiagnosticLocation &Location, // done as well as perform a lot of work we'll never need. // Gladly, none of our on-by-default checkers currently need it. DeclWithIssue = ACtx.getTranslationUnitDecl();

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

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I don't see much value in a backport, particularly since this affects back to Clang 12. Else, LGTM. https://github.com/llvm/llvm-project/pull/80395 ___ cfe-commits mailing list cfe-commits@lis

[clang] Fix clang crash when printing highlighted code in diagnostic (after #66514) (PR #80442)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/80442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix clang crash when printing highlighted code in diagnostic (after #66514) (PR #80442)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/80442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix clang crash when printing highlighted code in diagnostic (after #66514) (PR #80442)

2024-02-02 Thread Erich Keane via cfe-commits
@@ -1349,7 +1349,7 @@ void TextDiagnostic::emitSnippetAndCaret( // Prepare source highlighting information for the lines we're about to // emit, starting from the first line. std::unique_ptr[]> SourceStyles = - highlightLines(BufStart, Lines.first, Lines.second, PP,

[clang] [Clang] Fix a crash when dumping a pack indexing type. (PR #80439)

2024-02-02 Thread Erich Keane via cfe-commits
@@ -0,0 +1,24 @@ +// RUN: not %clang_cc1 -std=c++2c -ast-dump %s | FileCheck %s + +namespace InvalidPacksShouldNotCrash { + +struct NotAPack; +template typename Tp> +void not_pack() { +int i = 0; +i...[0]; // expected-error {{i does not refer to the name of a parameter

[clang] [Clang] Fix a crash when dumping a pack indexing type. (PR #80439)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. LGTM other than generalizing the test a bit. https://github.com/llvm/llvm-project/pull/80439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang][Sema] Correctly look up primary template for variable template specializations (PR #80359)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/80359 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose use of template keyword after declarative nested-name-specifiers (PR #78595)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/78595 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash when dumping a pack indexing type. (PR #80439)

2024-02-02 Thread Erich Keane via cfe-commits
@@ -0,0 +1,24 @@ +// RUN: not %clang_cc1 -std=c++2c -ast-dump %s | FileCheck %s + +namespace InvalidPacksShouldNotCrash { + +struct NotAPack; +template typename Tp> +void not_pack() { +int i = 0; +i...[0]; // expected-error {{i does not refer to the name of a parameter

[clang] [Clang] Fix a crash when dumping a pack indexing type. (PR #80439)

2024-02-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/80439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-02-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 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

<    6   7   8   9   10   11   12   13   14   15   >