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

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

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

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: 1 thought, else I don't see anything. @cor3ntin is coming back in a few days, so I'd like him to do a final once over. https://github.com/llvm/llvm-project/pull/82310 ___ cfe-commits mailing list

[clang] [clang-tools-extra] [Clang][Sema] Fix explicit specializations of member function templates with a deduced return type (PR #86817)

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

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-04-01 Thread Erich Keane via cfe-commits
Pol Marcet =?utf-8?q?Sard=C3=A0?= , Pol Marcet =?utf-8?q?Sard=C3=A0?= , Pol Marcet =?utf-8?q?Sard=C3=A0?= Message-ID: In-Reply-To: https://github.com/erichkeane commented: I would love it if @sethp can do another review, but only 1 nit from me.

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-04-01 Thread Erich Keane via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/76615 ___ cfe-commits mailing list

[clang] [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector (PR #76615)

2024-04-01 Thread Erich Keane via cfe-commits
Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= , Pol Marcet =?utf-8?q?Sardà?= Message-ID: In-Reply-To: @@ -10318,6 +10318,8 @@ def err_shufflevector_nonconstant_argument : Error< def err_shufflevector_argument_too_large : Error< "index for

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -131,7 +131,9 @@ struct BuiltinTypeDeclBuilder { DeclarationNameInfo NameInfo = DeclarationNameInfo(DeclarationName(), SourceLocation()); LookupResult R(S, NameInfo, Sema::LookupOrdinaryName); -S.LookupParsedName(R, S.getCurScope(), , false); +

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1287,7 +1287,10 @@ static ExprResult LookupMemberExpr(Sema , LookupResult , return ExprError(); QualType BaseType = BaseExpr.get()->getType(); + +#if 0 erichkeane wrote: Hmm? https://github.com/llvm/llvm-project/pull/84050

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -5789,7 +5789,10 @@ static ImplicitConversionSequence TryObjectArgumentInitialization( return ICS; } +// FIXME: Should this check getAsRecordDecl instead? erichkeane wrote: again. https://github.com/llvm/llvm-project/pull/84050

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -825,7 +825,10 @@ void Sema::ActOnPragmaUnused(const Token , Scope *curScope, IdentifierInfo *Name = IdTok.getIdentifierInfo(); LookupResult Lookup(*this, Name, IdTok.getLocation(), LookupOrdinaryName); - LookupParsedName(Lookup, curScope, nullptr, true); +

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1055,9 +1045,19 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, } } -Diag(R.getNameLoc(), diag::err_no_member) - << MemberName << DC - << (BaseExpr ? BaseExpr->getSourceRange() : SourceRange()); +if (SS.isNotEmpty() &&

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -131,7 +131,9 @@ struct BuiltinTypeDeclBuilder { DeclarationNameInfo NameInfo = DeclarationNameInfo(DeclarationName(), SourceLocation()); LookupResult R(S, NameInfo, Sema::LookupOrdinaryName); -S.LookupParsedName(R, S.getCurScope(), , false); +

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -990,6 +970,18 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, const Scope *S, bool SuppressQualifierCheck, ActOnMemberAccessExtraArgs *ExtraArgs) { +

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Quite a bit of cleanup level stuff, plus wanting 1 minor refactor here (re the lookup function), but otherwise is pretty good. https://github.com/llvm/llvm-project/pull/84050 ___ cfe-commits mailing list

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

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

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

2024-04-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > I'm not sure llvm needs to know the priorities. I haven't had time to work on > this, but my plan was to have something that attempts to step through the > resolver instruction by instruction with known bits for the value loaded from > `__aarch64_cpu_features.features`

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane Regarding "Still waiting on this?", I pushed a commit that > addresses the fixme. I'll be addressing the rest of your review comments in a > subsequent commit.. > > Also, if we are renaming `ExplicitInstantiationInfo::ExternLoc` to > `ExternKeywordLoc`, should

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

2024-04-01 Thread Erich Keane via cfe-commits
erichkeane wrote: I'd be OK with Clang providing some level of metadata to clarify which is an FMV, and what our target features are. But this sort of analysis still needs to happen in LLVM. https://github.com/llvm/llvm-project/pull/80093 ___

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1455,21 +1455,17 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream ) { // If this is a class template specialization, print the template // arguments. - if (const auto *Spec = dyn_cast(D)) { -ArrayRef Args; -TypeSourceInfo *TAW =

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1455,21 +1455,17 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream ) { // If this is a class template specialization, print the template // arguments. - if (const auto *Spec = dyn_cast(D)) { -ArrayRef Args; -TypeSourceInfo *TAW =

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A few more suggestions, also I like Shafik's suggestion on the variable name. https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -2545,10 +2545,12 @@ ASTDeclReader::VisitClassTemplateSpecializationDeclImpl( } // Explicit info. - if (TypeSourceInfo *TyInfo = readTypeSourceInfo()) { -auto *ExplicitInfo = -new (C) ClassTemplateSpecializationDecl::ExplicitSpecializationInfo; -

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -2596,27 +2588,14 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

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

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1735,48 +1757,21 @@ MemberExpr *MemberExpr::Create( ValueDecl *MemberDecl, DeclAccessPair FoundDecl, DeclarationNameInfo NameInfo, const TemplateArgumentListInfo *TemplateArgs, QualType T, ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR) { - bool

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 2 nits, else LGTM. https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

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

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -583,11 +583,14 @@ class alignas(void *) Stmt { unsigned IsArrow : 1; /// True if this member expression used a nested-name-specifier to -/// refer to the member, e.g., "x->Base::f", or found its member via -/// a using declaration. When true, a

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

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

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-01 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A quick few things I noticed, not nearly a thorough review. https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

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

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-03-12 Thread Erich Keane via cfe-commits
erichkeane wrote: Hi @Sirraide : I appreciate the patch! However, I'm not particularly likely to get a chance to take a look before I go to the WG21 meeting next week, so I'll likely need to review this in April when I get back. I just wanted to mention that so you don't think I'm ignoring

[clang] [clang] CTAD: Respect requires-clause of the original function template (PR #84913)

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

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

2024-03-12 Thread Erich Keane via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -std=c++20 -verify %s +// RUN: %clang_cc1 -std=c++23 -verify %s +// expected-no-diagnostics + +template concept IsOk = requires() { typename T::Float; }; + +template struct Thing; + +template struct Foobar { erichkeane wrote:

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

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

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

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

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-12 Thread Erich Keane via cfe-commits
erichkeane wrote: > > There are currently over 200 separate unions using the work-around. > > Specifically, this is what Linux uses for getting C99 flexible arrays in > unions and alone in structs: > > ``` > #define DECLARE_FLEX_ARRAY(TYPE, NAME)\ > struct { \ >

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > But then we (and GCC and MSVC) support the `[0]` extension syntax. So it's > not like codegen is impossible. > > https://godbolt.org/z/PGa9KWGxq > > ```c > union foo { > int a; > int b[]; // error: flexible array member 'b' in a union is not allowed > }; >

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > > C23 6.7.3.2p20: "As a special case, the last member of a structure with > > more than one named member may have an incomplete array type; this is > > called a flexible array member. ..." > > Thanks! Yeah, I wonder if that could have been "of a structure _or union_ " >

[clang] Add bit-precise overloads for builtin operators (PR #84755)

2024-03-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. LGTM if Corentin is happy with the comment. https://github.com/llvm/llvm-project/pull/84755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Left my comment on the main list > > Sorry, I missed this. Where? Bad phrasing: I jsut meant here: https://github.com/llvm/llvm-project/pull/84428#issuecomment-1987017272 I commented on the 'overall' patch, but then to do the 'needs revision', I needed to add a review

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > This direction looks good to me, mostly I just have nits. > > The one major change I'd consider before landing is to find a way to avoid > the verbosity regression cor3ntin mentions for `Diag()` and friends. > Notational regressions within Sema itself may be as important

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -4342,10 +4342,17 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, InstantiatingTemplate Inst(*this, TemplateLoc, Template); if (Inst.isInvalid()) return QualType(); +if (!AliasTemplate->getDeclContext()->isFileContext()) { + ContextRAII

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -0,0 +1,67 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

2024-03-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: The commit message and release note needs to be MUCH more detailed. Else I think this looks like an acceptable patch. https://github.com/llvm/llvm-project/pull/84671 ___ cfe-commits mailing list

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -409,7 +413,7 @@ RISC-V Support CUDA/HIP Language Changes ^ -- PTX is no longer included by default when compiling for CUDA. Using +- PTX is no longer included by default when compiling for CUDA. Using erichkeane wrote: Unrelated

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

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

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit, else LGTM. https://github.com/llvm/llvm-project/pull/83847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Left my comment on the main list, but I don't see this as a well motivated > > change, and even if GCC supported it, it would still be a very difficult to > > motivate extension without massive historical workloads already using it. > > This is needed by the Linux

[clang] Add bit-precise overloads for builtin operators (PR #84755)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -8955,6 +8962,22 @@ class BuiltinOperatorOverloadBuilder { (S.Context.getAuxTargetInfo() && S.Context.getAuxTargetInfo()->hasInt128Type())) ArithmeticTypes.push_back(S.Context.UnsignedInt128Ty); + +/// _BitInt overloads are a bit special. We don't

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. Left my comment on the main list, but I don't see this as a well motivated change, and even if GCC supported it, it would still be a very difficult to motivate extension without massive historical workloads already using it.

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-09 Thread Erich Keane via cfe-commits
erichkeane wrote: I'm pretty unmotivated here, I don't think it is worth allowing this all the time thanks to it not really being a conforming extension, and I don't think it is sufficiently worth creating a dialect over with the flag. >From what I can see, the GCC folks are equally as

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

2024-03-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > If we can come to a consensus as to what to do w/ `clang::assume` and > `__attribute__((assume))` reasonably soon, then I’ll handle `[[omp::assume]]` > in this pr as well; otherwise, I’ll open a pr for `[[omp::assume]]` tomorrow > or so. This patch is big enough as it is,

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

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

[clang] [Sema] Avoid unnecessary copy on MultiLevelTemplateArgumentList. NFC (PR #84459)

2024-03-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > Thanks. That explains now :) No problem! Feel free to change a bunch of them, I'm sure we pass by copy quite a bit, I chased out many of them a while back, but I'm sure i didnt get them all. https://github.com/llvm/llvm-project/pull/84459

[clang] [Sema] Avoid unnecessary copy on MultiLevelTemplateArgumentList. NFC (PR #84459)

2024-03-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Ah, this used to be a really small class, at one point it was an unsigned plus a handful of array-refs, so it made sense to pass by value. It seems to have grown a decent bit to the point that pass-by-const-ref now makes sense.

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > The clang-format check fails due to a change in `clang/docs/ReleaseNotes. > rst`, which isn't mine. What's the protocol? Shall I fix the format issue, or > can my change be merged anyway? Nope, don't worry about that one. That bot is being weird, feel free to merge

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I approve too, i trust you to update the comment for the new *PARAMETER* (not member, I'm a dummy) to make it clear. https://github.com/llvm/llvm-project/pull/84313 ___ cfe-commits mailing

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -19185,7 +19185,7 @@ static bool isLayoutCompatible(ASTContext , EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. erichkeane wrote: Can you update this comment for the new member? Is it both fields that are union members,

[clang] [clang] Add CodeGen tests for CWG 5xx issues (PR #84303)

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

[clang] [clang] Add CodeGen tests for CWG 5xx issues (PR #84303)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// 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] Validate ABI tag attributes (PR #84272)

2024-03-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Second: We create a new `Argument` type in `Attr.td`, and the code-gen > > infrastructure for it that takes an "identifier surrounded by quotes" (sort > > of a mix between `IdentifierArgument` and `StringArgument`). This has the > > effect of using our 'normal' parsing

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. I think this is a case of 'cure is worse than the disease'. Unless this implements our 'identifier' rules, it is just going to reject valid code. Any sort of enforcement here on individual characters NEEDS to follow the

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC () { +assert(OpenACCPtr); erichkeane wrote: I don't buy the 'noticeable impact on assertion build'

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC () { +assert(OpenACCPtr); erichkeane wrote: IMO, there is value to having the assert. I can

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -19185,7 +19185,8 @@ static bool isLayoutCompatible(ASTContext , EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. static bool isLayoutCompatible(ASTContext , FieldDecl *Field1, - FieldDecl *Field2) { +

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -1378,8 +1379,21 @@ bool CoroutineStmtBuilder::makeReturnOnAllocFailure() { static bool collectPlacementArgs(Sema , FunctionDecl , SourceLocation Loc, SmallVectorImpl ) { if (auto *MD = dyn_cast()) { -if

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -63,17 +67,17 @@ void Sema::ActOnOpenACCConstruct(OpenACCDirectiveKind K, // here as these constructs do not take any arguments. break; default: -Diag(StartLoc, diag::warn_acc_construct_unimplemented) << K; +Sema.Diag(StartLoc,

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -1200,6 +1200,27 @@ class Sema final { // // + /// \name Sema Components + /// Parts of Sema + ///@{ + + // Just in this section, private members are followed by public, because + // C++ requires us to create (private) objects before (public) references. +

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -63,17 +67,17 @@ void Sema::ActOnOpenACCConstruct(OpenACCDirectiveKind K, // here as these constructs do not take any arguments. break; default: -Diag(StartLoc, diag::warn_acc_construct_unimplemented) << K; +Sema.Diag(StartLoc,

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,68 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,68 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,68 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

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

2024-03-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I'm happy when Corentin is, so he can approve when he's ready. 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-03-06 Thread Erich Keane via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias

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

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

[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)

2024-03-06 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > Also, this probably needs a release note. > > > > > > If you want I'll add one but this bug has been on main no longer than a > > week, so I didnt think it would be necessary. > > I see. Yeah, I don’t think we really need one if the bug was introduced and > fixed in

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

2024-03-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/83715 ___ 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-05 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?Istv=C3=A1n_Horv=C3=A1th?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -10526,14

[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 ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -9463,7 +9463,8 @@ class

[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 ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -290,6 +290,12 @@ Bug

[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=C3=A1n_Horv=C3=A1th?=,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: @@ -5548,13

[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 ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/erichkeane edited

[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 ,Botond Istvan Horvath ,Botond Istvan Horvath Message-ID: In-Reply-To: https://github.com/erichkeane approved this

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I like the direction of this, and look forward to seeing how this turns out! https://github.com/llvm/llvm-project/pull/84050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[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

[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

[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

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

[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

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