[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -1156,9 +1156,11 @@ def ConstInit : InheritableAttr { def Constructor : InheritableAttr { let Spellings = [GCC<"constructor">]; - let Args = [DefaultIntArgument<"Priority", 65535>]; + let Args = [ExprArgument<"Priority", 1>]; let Subjects = SubjectList<[Function]>;

[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -10,3 +13,14 @@ struct Foo { bar(); } }; + +template erichkeane wrote: Please write a test where the argument is NTTP dependent on another template argument. https://github.com/llvm/llvm-project/pull/67376 __

[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: So it looks like this breaks the ast-dump-attr.cpp test, so that needs fixing. Also, there is quite a bit of changes happening around the SemaDeclAttr.cpp changes by @AaronBallman, so the two need to be merged in some way. https://github.com/llvm/llvm-p

[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -5661,10 +5662,20 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, setNonAliasAttributes(GD, Fn); SetLLVMFunctionAttributesForDefinition(D, Fn); - if (const ConstructorAttr *CA = D->getAttr()) -AddGlobalCtor(Fn, CA->getPriority()); + auto getPri

[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -1422,9 +1424,11 @@ def Deprecated : InheritableAttr { def Destructor : InheritableAttr { let Spellings = [GCC<"destructor">]; - let Args = [DefaultIntArgument<"Priority", 65535>]; + let Args = [ExprArgument<"Priority", 1>]; let Subjects = SubjectList<[Function]>;

[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -2352,26 +2352,37 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } +template +static void handleCtorDtorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + uint32_t priority = Attr::Defaul

[clang] [clang] All {con, de}structor attributes to use template args (PR #67376)

2023-09-25 Thread Erich Keane via cfe-commits
erichkeane wrote: > So it looks like this breaks the ast-dump-attr.cpp test, so that needs fixing. > > Also, there is quite a bit of changes happening around the SemaDeclAttr.cpp > changes by @AaronBallman, so the two need to be merged in some way. "Merged" could be: 1-rebased on the other, bu

[clang] [clang][Interp] Three-way comparisons (PR #65901)

2023-09-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This has been sitting a while, else I wouldn't feel comfortable reviewing (as I haven't been keeping up on these as much as I should have). However, I saw 1 issue with the comment I think, else I'm OK with this. So if you can fix that, I'll approve.

[clang] [clang][Interp] Three-way comparisons (PR #65901)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -253,6 +253,29 @@ bool ByteCodeExprGen::VisitBinaryOperator(const BinaryOperator *BO) { return this->delegate(RHS); } + // Special case for C++'s three-way/spaceship operator <=>, which + // returns a std::strong_ordering (which is class, so doesn't have a

[clang] [clang][Interp] Three-way comparisons (PR #65901)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -253,6 +253,29 @@ bool ByteCodeExprGen::VisitBinaryOperator(const BinaryOperator *BO) { return this->delegate(RHS); } + // Special case for C++'s three-way/spaceship operator <=>, which + // returns a std::strong_ordering (which is class, so doesn't have a

[clang] [clang][Interp] Three-way comparisons (PR #65901)

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

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-26 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -1596,6 +1599,9 @@ bool ByteCodeExprGen::visitZeroInitializer(QualType QT, return this->emitZeroSint64(E); case PT_Uint64: return this->emitZeroUint64(E); + case

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-26 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -0,0 +1,249 @@ +//===--- Integral.h - Wrapper for numeric types for the VM --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exce

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-26 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -0,0 +1,249 @@ +//===--- Integral.h - Wrapper for numeric types for the VM --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exce

[clang] [clang] Fix pretty-printing assume_aligned attributes (PR #67331)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -320,11 +320,12 @@ namespace { } std::string getIsOmitted() const override { - if (type == "IdentifierInfo *") + StringRef T = type; + if (T == "IdentifierInfo *" || T == "Expr *") return "!get" + getUpperName().str() + "()"; - if (type

[clang] [clang] Fix pretty-printing assume_aligned attributes (PR #67331)

2023-09-26 Thread Erich Keane via cfe-commits
erichkeane wrote: Also, it appears that the clang-format bot dislikes this commit (but frustratingly won't tell us why?), so perhaps run `git clang-format against all the commits here` https://github.com/llvm/llvm-project/pull/67331 ___ cfe-commits m

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
erichkeane wrote: > runtime, whereas a `consteval` one cannot. WDYT? This makes sense to me. Also, see my comment on https://github.com/llvm/llvm-project/pull/67376. It looks like someone else is messing with this area as well, and are editing things in an incompatible way, so we should mak

[clang] [clang] Fix pretty-printing assume_aligned attributes (PR #67331)

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

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Do we have a codegen test for the constexpr case? I'm concerned that we don't 'force' emission of these functions . Either way, I think this set of diagnostic changes makes sense. https://github.com/llvm/llvm-project/pull/67360 ___

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
erichkeane wrote: I think we're going to be stuck with 'warning-as-default-error' here, and let compiler-rt and tests/etc opt-out. I realize that makes the error not as effective, but it is really the one 'good' way for the 'implementation' in this case to handle itself. https://github.com/l

[clang] [Clang] Handle sema of noexcept condition in their evaluation context. (PR #67538)

2023-09-27 Thread Erich Keane via cfe-commits
@@ -718,3 +718,8 @@ void foo() { void GH48527() { auto a = []()__attribute__((b(({ return 0; }{}; // expected-warning {{unknown attribute 'b' ignored}} } + +void GH67492() { + constexpr auto test = 42; + auto lambda = (test, []() noexcept(true) {}); er

[clang] [clang][Interp] Three-way comparisons (PR #65901)

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

[clang] [Clang] Handle sema of noexcept condition in their evaluation context. (PR #67538)

2023-09-27 Thread Erich Keane via cfe-commits
@@ -718,3 +718,8 @@ void foo() { void GH48527() { auto a = []()__attribute__((b(({ return 0; }{}; // expected-warning {{unknown attribute 'b' ignored}} } + +void GH67492() { + constexpr auto test = 42; + auto lambda = (test, []() noexcept(true) {}); er

[clang] [Clang] Handle sema of noexcept condition in their evaluation context. (PR #67538)

2023-09-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane resolved https://github.com/llvm/llvm-project/pull/67538 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Handle sema of noexcept condition in their evaluation context. (PR #67538)

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

[clang] [Clang] Handle sema of noexcept condition in their evaluation context. (PR #67538)

2023-09-27 Thread Erich Keane via cfe-commits
@@ -718,3 +718,8 @@ void foo() { void GH48527() { auto a = []()__attribute__((b(({ return 0; }{}; // expected-warning {{unknown attribute 'b' ignored}} } + +void GH67492() { + constexpr auto test = 42; + auto lambda = (test, []() noexcept(true) {}); er

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-27 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -0,0 +1,249 @@ +//===--- Integral.h - Wrapper for numeric types for the VM --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache Lic

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I think this generally makes a lot of sense, I have 1 nit (plus a bunch of the 'bool' comments without the = sign that @shafik suggested, but were closed without comment), otherwise LGTM. https://github.com/llvm/llvm-project/pull/66222 _

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-27 Thread Erich Keane via cfe-commits
@@ -221,6 +221,15 @@ ExprResult Parser::ParseConstantExpression() { return ParseConstantExpressionInExprEvalContext(NotTypeCast); } +ExprResult Parser::ParseArrayBoundExpression() { + EnterExpressionEvaluationContext ConstantEvaluated( + Actions, Sema::ExpressionEvalua

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

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

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-27 Thread Erich Keane via cfe-commits
@@ -221,6 +221,15 @@ ExprResult Parser::ParseConstantExpression() { return ParseConstantExpressionInExprEvalContext(NotTypeCast); } +ExprResult Parser::ParseArrayBoundExpression() { + EnterExpressionEvaluationContext ConstantEvaluated( + Actions, Sema::ExpressionEvalua

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

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

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Still OK with this, but Shafik should do the final approval. https://github.com/llvm/llvm-project/pull/66222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

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

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

2023-09-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: >From what I can tell, this looks correct, though I don't know much about this >rewriter, I've only spent a little time reviewing it. That said, i think this >is a very nice improvement. One thing I might request (in addition to what I did in teh comme

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

2023-09-28 Thread Erich Keane via cfe-commits
@@ -332,12 +346,14 @@ void InclusionRewriter::CommentOutDirective(Lexer &DirectiveLex, // OutputContentUpTo() would not output anything anyway. return; } - OS << "#if 0 /* expanded by -frewrite-includes */" << MainEOL; + OS << "#if 0 /* " << getIncludedFileName(Inc

[clang] [clang][Interp] Add IntegralAP for arbitrary-precision integers (PR #65844)

2023-09-29 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= , Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/65844 __

[clang-tools-extra] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-29 Thread Erich Keane via cfe-commits
@@ -1333,7 +1333,13 @@ void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) { void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) { VisitExpr(S); S->getValue().Profile(ID); - ID.AddInteger(S->getType()->castAs()->getKind()); + + QualType T = S->get

[clang] [clang] Add missing canonicalization in int literal profile (PR #67822)

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

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

2023-09-29 Thread Erich Keane via cfe-commits
@@ -332,12 +346,14 @@ void InclusionRewriter::CommentOutDirective(Lexer &DirectiveLex, // OutputContentUpTo() would not output anything anyway. return; } - OS << "#if 0 /* expanded by -frewrite-includes */" << MainEOL; + OS << "#if 0 /* " << getIncludedFileName(Inc

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

2023-09-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This looks great/useful to me. I have no problems with it, but would like to give this a bit of time for others to review. If this doesn't get other comments by friday next week, I'll approve. https://github.com/llvm/llvm-project/pull/67613 __

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-02 Thread Erich Keane via cfe-commits
@@ -2129,7 +2129,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( Function = CXXDeductionGuideDecl::Create( SemaRef.Context, DC, D->getInnerLocStart(), InstantiatedExplicitSpecifier, NameInfo, T, TInfo, -D->getSourceRange().getEnd(), /*Ctor=*/

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems right to me, however we need to do 2 things: 1- This needs a release note. 2- We need to track down when this changed in the standard, and why. If it was a DR, we need to do make sure we update that we've implemented that DR. If it was a n

[clang] [clang][Interp] Implement IntegralAP::comp (PR #67954)

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

[clang] [clang][Interp] Fix value truncation when casting int128 to smaller size (PR #67961)

2023-10-02 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -249,6 +248,11 @@ template class IntegralAP final { R->V = A.V - B.V; return false; // Success! } + erichkeane wrote: Is this template forward declared? Either way, I think as none of the calls

[clang] [clang][Interp] Implement __builtin_popcount() (PR #67929)

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

[clang] [clang][Interp] Implement __builtin_popcount() (PR #67929)

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

[clang] [clang][Interp] Implement __builtin_popcount() (PR #67929)

2023-10-02 Thread Erich Keane via cfe-commits
@@ -260,3 +260,12 @@ namespace SourceLocation { static_assert(c.a.n == __LINE__ - 1, ""); } } + +namespace popcount { + static_assert(__builtin_popcount(~0u) == __CHAR_BIT__ * sizeof(unsigned int), ""); erichkeane wrote: I would suggest more 'difficult

[clang] [clang][Interp] Fix value truncation when casting int128 to smaller size (PR #67961)

2023-10-02 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/67961 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang][Interp] Implement __builtin_popcount() (PR #67929)

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

[clang] [clang][Interp] Fix value truncation when casting int128 to smaller size (PR #67961)

2023-10-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/67961 ___ 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 when instantiating a lambda with requires clause (PR #65193)

2023-10-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/65193 ___ 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 when instantiating a lambda with requires clause (PR #65193)

2023-10-02 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Just a pair of nits based on the style guide, else LGTM. https://github.com/llvm/llvm-project/pull/65193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang][Sema] Fix a bug when instantiating a lambda with requires clause (PR #65193)

2023-10-02 Thread Erich Keane via cfe-commits
@@ -2256,33 +2256,55 @@ ExprResult Sema::BuildBlockForLambdaConversion(SourceLocation CurrentLocation, return BuildBlock; } +static FunctionDecl *getPatternFunctionDecl(FunctionDecl *FD) { + if (FD->getTemplatedKind() == FunctionDecl::TK_MemberSpecialization) { +while

[clang] [clang][Sema] Fix a bug when instantiating a lambda with requires clause (PR #65193)

2023-10-02 Thread Erich Keane via cfe-commits
@@ -7370,7 +7370,8 @@ class Sema final { public: LambdaScopeForCallOperatorInstantiationRAII( Sema &SemasRef, FunctionDecl *FD, MultiLevelTemplateArgumentList MLTAL, -LocalInstantiationScope &Scope); +LocalInstantiationScope &Scope, +bool s

[clang] [diag] Silence `-Wfixed-enum-extension` in C23 (PR #68060)

2023-10-03 Thread Erich Keane via cfe-commits
@@ -5019,7 +5019,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, else if (getLangOpts().MicrosoftExt) Diag(ColonLoc, diag::ext_ms_c_enum_fixed_underlying_type) << BaseRange; -else +else if (!getLangOpt

[clang-tools-extra] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Erich Keane via cfe-commits
erichkeane wrote: > The paper where this came from is: https://wg21.link/P0620R0. most of this > paper was already implemented. Where is the paper tracking doc I need to > update? https://clang.llvm.org/cxx_status.html claims this paper is > implemented. Sorry if the following questions are tr

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Erich Keane via cfe-commits
erichkeane wrote: > The paper where this came from is: https://wg21.link/P0620R0. most of this > paper was already implemented. Where is the paper tracking doc I need to > update? https://clang.llvm.org/cxx_status.html claims this paper is > implemented. Sorry if the following questions are tr

[clang] [diag] Silence `-Wfixed-enum-extension` in C23 (PR #68060)

2023-10-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I believe this needs a release note as well (see docs/ReleaseNotes.rst), else this LGTM. https://github.com/llvm/llvm-project/pull/68060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [diag] Silence `-Wfixed-enum-extension` in C23 (PR #68060)

2023-10-03 Thread Erich Keane via cfe-commits
@@ -216,6 +216,9 @@ Improvements to Clang's diagnostics - The fix-it emitted by ``-Wformat`` for scoped enumerations now take the enumeration's underlying type into account instead of suggesting a type just based on the format string specifier being used. +- ``-Wfixed-enum-

[clang] [diag] Silence `-Wfixed-enum-extension` in C23 (PR #68060)

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

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Erich Keane via cfe-commits
@@ -390,6 +390,10 @@ Bug Fixes to C++ Support we now produce a diagnostic. Fixes: (`#65522 `_) +- Fixed a bug where clang couldn't choose the correct deduction guide from + two implicitly generated deduction guides. One o

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Erich Keane via cfe-commits
@@ -390,6 +390,11 @@ Bug Fixes to C++ Support we now produce a diagnostic. Fixes: (`#65522 `_) +- Fixed a bug where clang incorrectly considered implicitly generated deduction + guides from a non-templated constructor and

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Just need a period after the note, otherwise LGTM! https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

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

[libclc] [clang] Choose non-templated ctor as deduction guide unambiguously (PR #66487)

2023-10-04 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Hprváth?=, Botond =?utf-8?q?István_Hprváth?Message-ID: In-Reply-To: https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[libclc] [clang] Choose non-templated ctor as deduction guide unambiguously (PR #66487)

2023-10-04 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?Istv=C3=A1n_Hprv=C3=A1th?=, Botond =?utf-8?q?Istv=C3=A1n_Hprv=C3=A1th?= Message-ID: In-Reply-To: erichkeane wrote: I had permissions, so I squash/merged. https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cf

[clang-tools-extra] [clang] Choose non-templated ctor as deduction guide unambiguously (PR #66487)

2023-10-04 Thread Erich Keane via cfe-commits
Botond =?utf-8?q?István_Hprváth?=, Botond =?utf-8?q?István_Hprváth?Message-ID: In-Reply-To: erichkeane wrote: Ah, I see, apologies. I thought you meant the resign/etc complaint meant you couldn't commit through the UI. https://github.com/llvm/llvm-project/pull/66487 _

[clang] [clang] Correct behavior of `LLVM_UNREACHABLE_OPTIMIZE=OFF` for `Release` builds (PR #68284)

2023-10-05 Thread Erich Keane via cfe-commits
erichkeane wrote: Agree with Aaron on all points! https://github.com/llvm/llvm-project/pull/68284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Correct behavior of `LLVM_UNREACHABLE_OPTIMIZE=OFF` for `Release` builds (PR #68284)

2023-10-05 Thread Erich Keane via cfe-commits
@@ -343,6 +343,8 @@ Bug Fixes in This Version - Fix a crash when evaluating value-dependent structured binding variables at compile time. Fixes (`#67690 `_) +- Fixes a regression where ``LLVM_UNREACHABLE_OPTIMIZE=OFF`` cann

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-05 Thread Erich Keane via cfe-commits
@@ -2064,13 +2064,26 @@ static void handleTLSModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) { static void handleRestrictAttr(Sema &S, Decl *D, const ParsedAttr &AL) { QualType ResultType = getFunctionOrMethodResultType(D); - if (ResultType->isAnyPointerType() || ResultT

[clang] [clang][Sema] Use original template pattern when declaring implicit deduction guides for nested template classes (PR #68379)

2023-10-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems reasonable, however it needs a release note. https://github.com/llvm/llvm-project/pull/68379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Also needs a release note. https://github.com/llvm/llvm-project/pull/68276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

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

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-06 Thread Erich Keane via cfe-commits
@@ -6171,6 +6171,9 @@ def warn_signed_bitfield_enum_conversion : Warning< "signed bit-field %0 needs an extra bit to represent the largest positive " "enumerators of %1">, InGroup, DefaultIgnore; +def warn_bitfield_too_small_for_integral_type : Warning< + "bit-field %0 (

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,36 @@ +// RUN: %clang_cc1 -Wconversion -fsyntax-only -verify %s + +typedef struct _xx { + int bf:9; // expected-note{{widen this field to 32 bits to store all values of 'int'}} + // expected-note@-1{{widen this field to 16 bits to store all values of 'short'}}

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

2023-10-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: The clang-format tool still has a complaint, so this isn't passing CI. Unfortunately it doesn't seem to print it in the CI, so you'll have to run it locally. Delta that, LGTM. https://github.com/llvm/llvm-project/pull/67613 ___

[clang] Add -fkeep-system-includes modifier for -E (PR #67684)

2023-10-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This too fails the formatter. That said, I have no comments, though preprocessing isn't my place of expertise. Most of the changes are pretty mild though, and the approach of just replacing the output file with a null-OS seems appropriate. Fix the fo

[clang] Make -frewrite-includes put an endif at the end of the included text (PR #67613)

2023-10-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Approved, assuming this passes CI. https://github.com/llvm/llvm-project/pull/67613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] Add -fkeep-system-includes modifier for -E (PR #67684)

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

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-06 Thread Erich Keane via cfe-commits
erichkeane wrote: If Aaron doesn't get to it, feel free to ping me on Monday. Its too late on a Friday for me to be able to merge this for you, but monday morning would be fine for me. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits

[clang] [Sema] Handle large shift counts in GetExprRange (PR #68590)

2023-10-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: So the change itself looks right. The comment at the top of the test belongs in the commit message/github discussion, not in the test itself. Also, needs a release note. https://github.com/llvm/llvm-project/pull/68590 __

[clang] [Sema] Handle large shift counts in GetExprRange (PR #68590)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -219,6 +219,10 @@ Bug Fixes in This Version - Clang no longer considers the loss of ``__unaligned`` qualifier from objects as an invalid conversion during method function overload resolution. +- Fixed an issue when a shift count larger than ``__INT64_MAX__``, in a right

[clang] [Sema] Handle large shift counts in GetExprRange (PR #68590)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -verify -fsyntax-only -std=c2x -triple=x86_64-unknown-linux %s + +// Regression test for bug where we used to hit assertion due to shift amount erichkeane wrote: ```suggestion // Regression test for bug where we used to hit a

[clang] [Sema] Handle large shift counts in GetExprRange (PR #68590)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -verify -fsyntax-only -std=c2x -triple=x86_64-unknown-linux %s + +// Regression test for bug where we used to hit assertion due to shift amount +// being larger than 64 bits. We want to see a warning about too large shift +// amount. +void tes

[clang] [Sema] Handle large shift counts in GetExprRange (PR #68590)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -verify -fsyntax-only -std=c2x -triple=x86_64-unknown-linux %s + +// Regression test for bug where we used to hit assertion due to shift amount +// being larger than 64 bits. We want to see a warning about too large shift +// amount. +void tes

[clang] [Sema] Handle large shift counts in GetExprRange (PR #68590)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -verify -fsyntax-only -std=c2x -triple=x86_64-unknown-linux %s + +// Regression test for bug where we used to hit assertion due to shift amount +// being larger than 64 bits. We want to see a warning about too large shift +// amount. +void tes

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

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

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -18406,9 +18406,10 @@ static void EvaluateAndDiagnoseImmediateInvocation( FD = Call->getConstructor(); else if (auto *Cast = dyn_cast(InnerExpr)) FD = dyn_cast_or_null(Cast->getConversionFunction()); - erichkeane wrote: Unrelated change. ht

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s + +// expected-note@+2{{candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'S &&' for 1st argument}} +// expected-note@+1{{candidate constructor (the implicit

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Needs a release note, plus a couple nits. Otherwise LGTM! https://github.com/llvm/llvm-project/pull/68646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang]Avoid diagnose invalid consteval call for invalid function decl (PR #68646)

2023-10-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s + +// expected-note@+2{{candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'S &&' for 1st argument}} erichkeane wrote: Can you use the bookm

[clang] [clang][Interp] Support AddOffset with 128bit offsets (PR #68679)

2023-10-10 Thread Erich Keane via cfe-commits
@@ -1437,7 +1437,7 @@ bool OffsetHelper(InterpState &S, CodePtr OpPC, const T &Offset, return false; }; - unsigned MaxOffset = MaxIndex - Ptr.getIndex(); + T MaxOffset = T::from(MaxIndex - Ptr.getIndex(), Offset.bitWidth()); erichkeane wrote: Should

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Erich Keane via cfe-commits
@@ -3,6 +3,14 @@ // RUN: %clang_cc1 -std=c++11 -fms-extensions -verify=ref %s // RUN: %clang_cc1 -std=c++20 -fms-extensions -verify=ref %s + +constexpr _BitInt(2) A = 0; +constexpr _BitInt(2) B = A + 1; +constexpr _BitInt(2) C = B + 1; // expected-warning {{from 2 to -2}} \ --

[clang] [clang][Interp] Add basic support for _BitInt (PR #68069)

2023-10-10 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/68069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang] Improve `_Alignas` on a `struct` declaration diagnostic (PR #65638)

2023-10-11 Thread Erich Keane via cfe-commits
@@ -186,14 +186,14 @@ class AttributeCommonInfo { bool isGNUScope() const; bool isClangScope() const; - bool isCXX11Attribute() const { return SyntaxUsed == AS_CXX11 || IsAlignas; } - + bool isAlignas() const { return IsAlignas; } + bool isCXX11Attribute() const { retur

[clang] [clang] Improve `_Alignas` on a `struct` declaration diagnostic (PR #65638)

2023-10-11 Thread Erich Keane via cfe-commits
@@ -186,14 +186,14 @@ class AttributeCommonInfo { bool isGNUScope() const; bool isClangScope() const; - bool isCXX11Attribute() const { return SyntaxUsed == AS_CXX11 || IsAlignas; } - + bool isAlignas() const { return IsAlignas; } + bool isCXX11Attribute() const { retur

[clang] [clang] Differentiate between identifier and string EnumArgument (PR #68550)

2023-10-11 Thread Erich Keane via cfe-commits
@@ -274,20 +274,27 @@ class DefaultIntArgument : IntArgument { } // This argument is more complex, it includes the enumerator type name, -// a list of strings to accept, and a list of enumerators to map them to. -class EnumArgument values, +// a list of possible values, and a

<    10   11   12   13   14   15   16   17   18   19   >