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

[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

[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

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

[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

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

[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

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

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

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

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

[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] 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] 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/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 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-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-02 Thread Erich Keane via cfe-commits
@@ -100,6 +100,12 @@ void AttributePool::takePool(AttributePool ) { pool.Attrs.clear(); } +void AttributePool::takeFrom(ParsedAttributesView , AttributePool ) { + assert( != this && "AttributePool can't take attributes from itself"); + llvm::for_each(List.AttrList,

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

[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

[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] 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] [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] [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] 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] [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] [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 , FunctionTemplateDecl *Sema::getMoreSpecializedTemplate(

[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

[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

[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

[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

[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

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

[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 , FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2,

[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

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

[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 , FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2,

[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 , FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2,

[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: https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/83279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[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 , TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplateParams, +

[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 , erichkeane wrote: I

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

[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 , FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLocation Loc,

[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

[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 , FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLocation Loc,

[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] 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] 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
@@ -857,6 +864,36 @@ void AArch64TargetCodeGenInfo::checkFunctionCallABI( << Callee->getDeclName(); } +void AArch64ABIInfo::appendAttributeMangling(TargetClonesAttr *Attr, + unsigned Index, +

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-28 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Hm actually reopening, the metadata isn't emitted if the defnition isn't > > available [e.g. for `extern int X;` when given an annotation > > That seems like a bug (so long as the declaration is actually emitted to LLVM > IR at all). > > > @AaronBallman @erichkeane, do

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-02-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I don't have any concerns, but want @cor3ntin to take a look. He's under the weather at the moment, so he might be a few days. https://github.com/llvm/llvm-project/pull/82310 ___ cfe-commits mailing list

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

2024-02-28 Thread Erich Keane via cfe-commits
erichkeane wrote: > For what it's worth, this change adds several instances of > `-Wenum-enum-conversion` for the Linux kernel: > [ClangBuiltLinux/linux#2002](https://github.com/ClangBuiltLinux/linux/issues/2002). > I assume this is intentional given the nature of the change as a whole but >

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

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

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

2024-02-27 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

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

2024-02-27 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: No additional comments from me, if the other reviewers are happy, I'm happy with where this is/is going. https://github.com/llvm/llvm-project/pull/78000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: We'd need to see what @alexey-bataev has to say about renaming the OMP assume attribute. I imagine that'll end up causing a headache for his users. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I might lean toward CXXAssumeAttr and OMPAssumeAttr ? > > That’s a good idea actually. I have those occasionally :) https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Of the three, I lean towards 3 actually, I think that is perhaps the BEST > > idea, and is perhaps supported by our existing infrastructure already (if > > you have Attr.td set its targets right?). I'd like to see what Aaron has to > > say, but I THINK that is my

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: >I suppose the only question now is whether [[clang::assume]] should be treated >like [[assume]] if it’s not applied to a function declaration? THAT is an interesting question that @AaronBallman might have some comments on... Effectively, we have TWO 'assume' attributes- 1-

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

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: I definitely agree with both of Shafik's comments! The fix itself concerns me, the logic in the block that is having its condition inverted is specifically made for 'if no array size was specified' (see comment), so that makes me think this is an incorrect patch. It

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

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Hi- Sorry for the delay, I didn't see the updated commit, so thanks for the ping. In general this is 'about right', but I don't like the 'getManglingSuffix' type of thing. I believe we should have these functions take an ostream and append to it, that

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > So my understanding was that the annotate attribute didn't modify codegen > (and thus LLVM string attributes), but perhaps I didn't use it properly. > > Is there any reference for that? I'm not sure what you mean by that? the 'annotate' attribute just ends up in an

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > @AaronBallman @erichkeane, do you have any suggestions for paths forward, for > use cases where it is guaranteed that the attribute is valid and the user (or > perhaps more specifically, another Clang-tool) needs to provide information > to LLVM through Clang AST/source. >

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: There are a few things in how the `handle` function works that are incorrect/not necessary, but like Aaron, I'm pretty solidly against this patch in concept. Aaron had some good reasoning, and mine opinion reflects all of it.

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > Since we didn’t bring this up in the RFC, do we have any idea as to what we > should do with `[[clang::assume]]`? > > My suggestion would be to keep the current semantics for `[[clang::assume]]` > (and `__attribute__((assume))`, but probably _not_ `[[assume]]`) iff the >

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

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

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

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

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Clang changes look fine, but I don't have the expertise to review the LLVM changes, so whoever reviews LLVM feel free to 'approve' when you're ready. https://github.com/llvm/llvm-project/pull/79035 ___

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

2024-02-26 Thread Erich Keane via cfe-commits
@@ -2612,44 +2669,313 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList

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

2024-02-26 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

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

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

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

2024-02-26 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

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

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: We probably need an entry in ReleaseNotes.rst here as well. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-02-26 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for

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

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

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
erichkeane wrote: Side note: In the future can you be more descriptive with follow up commit messages, isntead of just `[FOLD]`. That doesn't really tell me whether I need to re-review/give context, particularly since I do much of that triage in email. As far as this patch, feel free to

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

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

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit on the release notes, else lgtm. https://github.com/llvm/llvm-project/pull/83024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Needs a release note if this exists in a previous release. Also, do you have a bug report here? https://github.com/llvm/llvm-project/pull/83024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,67 @@ static void handleAMDGPUNumVGPRAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +// Returns true if error +static bool +checkAMDGPUMaxNumWorkGroupsArguments(Sema , Expr *XExpr, Expr

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,67 @@ static void handleAMDGPUNumVGPRAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +// Returns true if error erichkeane wrote: Comment not necessary, just remove it.

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -607,6 +607,29 @@ static void instantiateDependentAMDGPUWavesPerEUAttr( S.addAMDGPUWavesPerEUAttr(New, Attr, MinExpr, MaxExpr); } +static void instantiateDependentAMDGPUMaxNumWorkGroupsAttr( +Sema , const MultiLevelTemplateArgumentList , +const

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Clang is mostly good, needs an entry in `ReleaseNotes.rst`. Also, a Clang 'codegen' test for templates (see the example I gave you!) would be helpful as well. https://github.com/llvm/llvm-project/pull/79035

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

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

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

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

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

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

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

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A couple more coding standard edits, else LGTM. https://github.com/llvm/llvm-project/pull/81418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-02-23 Thread Erich Keane via cfe-commits
@@ -4097,6 +4105,13 @@ FieldDecl *Expr::getSourceBitField() { return nullptr; } +EnumConstantDecl *Expr::getEnumConstantDecl() { + Expr *E = this->IgnoreParenImpCasts(); + if (DeclRefExpr *DRE = dyn_cast(E)) erichkeane wrote: ```suggestion if (auto

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

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

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

2024-02-23 Thread Erich Keane via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext ) const { + if (isa(this->getType())) +return this->getType(); + else if (const EnumConstantDecl *ECD = this->getEnumConstantDecl()) erichkeane wrote:

<    3   4   5   6   7   8   9   10   11   12   >