[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-15 Thread via cfe-commits
@@ -80,6 +81,13 @@ class TemplateArgument { /// that was provided for an integral non-type template parameter. Integral, +/// The template argument is a non-type template argument that can't be +/// represented by the special-case Declaration, NullPtr, or Integ

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-15 Thread via cfe-commits
cor3ntin wrote: > > Should we add a couple of PCH tests ? > > [clang/test/Modules/odr_hash.cpp](https://github.com/llvm/llvm-project/pull/78041/files#diff-b0662120e3a8a2bf3ccd95b9e8943640816b457c00e662ebfdd648632e383314) > should cover AST serialization/deserialization. But I could missing > s

[lldb] [clang-tools-extra] [clang] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-15 Thread via cfe-commits
cor3ntin wrote: I'm tempted to think that we should accept / merge this now @AaronBallman The logic is that this is a pretty big hole in our C++20 support and I don't think it's reasonable to try a merge after the deadline for 18. WDYT? https://github.com/llvm/llvm-project/pull/78041

[lldb] [clang] [clang-tools-extra] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-15 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > The logic is that this is a pretty big hole in our C++20 support and I don't > think it's reasonable to try a merge after the deadline for 18. WDYT? >From our past experience with release managers, they seem quite generous with >deadlines to merge stuff in, as long as maintain

[clang] cfa30fa - [clang][test][NFC] Enable more tests with new constexpr interpreter

2024-01-15 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-01-15T13:57:43+01:00 New Revision: cfa30fa4852275eed0c59b81b5d8088d3e55f778 URL: https://github.com/llvm/llvm-project/commit/cfa30fa4852275eed0c59b81b5d8088d3e55f778 DIFF: https://github.com/llvm/llvm-project/commit/cfa30fa4852275eed0c59b81b5d8088d3e55f778.diff LO

[clang] [Clang] Amend SME attributes with support for ZT0. (PR #77941)

2024-01-15 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/77941 >From 764e7aaecffb758e7a311c17a189ee605c623246 Mon Sep 17 00:00:00 2001 From: Sander de Smalen Date: Thu, 4 Jan 2024 14:03:04 + Subject: [PATCH 1/2] [Clang] Amend SME attributes with support for ZT0. T

[clang] [Clang] Rename and enable boolean get, set, create and undef for sme2 (PR #77338)

2024-01-15 Thread Kerry McLaughlin via cfe-commits
https://github.com/kmclaughlin-arm approved this pull request. https://github.com/llvm/llvm-project/pull/77338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Allow explicit specification of -lFortran_main (PR #78152)

2024-01-15 Thread Tom Eccles via cfe-commits
https://github.com/tblah updated https://github.com/llvm/llvm-project/pull/78152 >From 5c7fa9c3ef911674e5b6888fcba4289834d04fda Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Mon, 15 Jan 2024 11:27:46 + Subject: [PATCH 1/2] [flang][driver] Allow explicit specification of -lFortran_main I

[clang] [clang-tools-extra] [llvm] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -6784,6 +6784,12 @@ def warn_pointer_sub_null_ptr : Warning< def warn_floatingpoint_eq : Warning< "comparing floating point with == or != is unsafe">, InGroup>, DefaultIgnore; +def warn_fast_floatingpoint_eq : Warning< + "%select{explicit comparison with|use of}0 %selec

[llvm] [clang] [clang-tools-extra] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -13861,6 +13897,36 @@ Sema::CheckReturnValExpr(Expr *RetValExp, QualType lhsType, CheckPPCMMAType(RetValExp->getType(), ReturnLoc); } +/// Diagnose comparison to NAN or INFINITY in fast math modes. +/// The comparison to NaN or INFINITY is always false in +/// fast mod

[clang] [clang][Interp] Support __real/__imag on primitives (PR #75485)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/75485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -836,6 +836,8 @@ ANNOTATION(primary_expr) // annotation for a primary expression, used when // message send ANNOTATION(decltype) // annotation for a decltype expression, // e.g., "decltype(foo.bar())" +ANNOTATION(indexed

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -1884,6 +1884,10 @@ class Parser : public CodeCompletionHandler { // C++ Expressions ExprResult tryParseCXXIdExpression(CXXScopeSpec &SS, bool isAddressOfOperand, Token &Replacement); + + ExprResult tryParseCXXPackIndexingExpression(

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -5697,6 +5698,39 @@ QualType ASTContext::getDecltypeType(Expr *e, QualType UnderlyingType) const { return QualType(dt, 0); } +QualType ASTContext::getPackIndexingType(QualType Pattern, Expr *IndexExpr, + bool FullyExpanded, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -1665,6 +1665,43 @@ NonTypeTemplateParmDecl *SubstNonTypeTemplateParmExpr::getParameter() const { getReplacedTemplateParameterList(getAssociatedDecl())->asArray()[Index]); } +PackIndexingExpr *PackIndexingExpr::Create(ASTContext &Context, +

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -4193,6 +4194,13 @@ void CXXNameMangler::mangleType(const PackExpansionType *T) { mangleType(T->getPattern()); } +void CXXNameMangler::mangleType(const PackIndexingType *T) { cor3ntin wrote: I did ping Cameron, who will get back to me, I think we should

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/77294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/AaronBallman approved this pull request. LGTM with a testing request https://github.com/llvm/llvm-project/pull/77294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: @@ -37,6 +37,18 @@ constexpr _Complex int I2 = {}; static_assert(__real(I2) == 0, ""); static_assert(__imag(I2) == 0, ""); +constexpr int ignoredCast() { + I2; + (int)I2; + (float)I2; + D1; + (int)D1; + (double)D1;

[clang-tools-extra] [clang] [clang-tidy] Added new check to detect redundant inline keyword (PR #73069)

2024-01-15 Thread Félix-Antoine Constantin via cfe-commits
felix642 wrote: ping @EugeneZelenko https://github.com/llvm/llvm-project/pull/73069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Use parseArchExtension function. NFC (PR #78158)

2024-01-15 Thread Anatoly Trosinenko via cfe-commits
https://github.com/atrosinenko created https://github.com/llvm/llvm-project/pull/78158 None >From 2c4ebf05d3d85cb9541cefc446f3a85abc64ec22 Mon Sep 17 00:00:00 2001 From: Anatoly Trosinenko Date: Sat, 13 Jan 2024 12:14:46 +0300 Subject: [PATCH] [AArch64] Use parseArchExtension function. NFC --

[clang] [llvm] [AArch64] Use parseArchExtension function. NFC (PR #78158)

2024-01-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 Author: Anatoly Trosinenko (atrosinenko) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/78158.diff 2 Files Affected: - (modified) clang/lib/Basic/Targets/AArch64.cpp (+9-15) - (modified) llvm/lib/TargetParser/AArch

[llvm] [clang] [AArch64] Use parseArchExtension function. NFC (PR #78158)

2024-01-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Anatoly Trosinenko (atrosinenko) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/78158.diff 2 Files Affected: - (modified) clang/lib/Basic/Targets/AArch64.cpp (+9-15) - (modified) llvm/lib/TargetParser/AArch64TargetPa

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -1061,6 +1070,59 @@ ExprResult Sema::ActOnSizeofParameterPackExpr(Scope *S, RParenLoc); } +static bool isParameterPack(Expr *PackExpression) { + if (auto D = dyn_cast(PackExpression); D) { +ValueDecl *VD = D->getDecl(); +return VD->i

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/73017 >From 0cbb267cd3b18308acd3fc0b3b68132a2090b5b6 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Mon, 20 Nov 2023 18:03:18 + Subject: [PATCH 1/4] [APINotes] Upstream attributes that are created implicitly fr

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/78159 Fixes https://github.com/llvm/llvm-project/issues/51710 >From f86766ff519ab2b802c0f1ac6c8138cbeadd543a Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 15 Jan 2024 14:30:18 +0100 Subject: [PATCH] [clang] Fix

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes Fixes https://github.com/llvm/llvm-project/issues/51710 --- Full diff: https://github.com/llvm/llvm-project/pull/78159.diff 3 Files Affected: - (modified) clang/docs/ReleaseNotes.rst (+2) - (modified) clang/

[clang] [clang][Interp] Fix diagnosing non-const variables pre-C++11 (PR #76718)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,36 @@ +// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -verify=both,expected -std=c++98 %s +// RUN: %clang_cc1 -verify=both,ref -std=c++98 %s + + + +namespace IntOrEnum { + const int k = 0; + const int &p = k; // both-note {{declared here}} + template str

[clang] [clang][Interp] Fix diagnosing non-const variables pre-C++11 (PR #76718)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/76718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Fix diagnosing non-const variables pre-C++11 (PR #76718)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM with a testing nit https://github.com/llvm/llvm-project/pull/76718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 7e604485e18d40be6ce6310e4a3e583ca0b7df47 f86766ff519ab2b802c0f1ac6c8138cbeadd543a --

[clang] [clang][Interp] Implement integral->complex casts (PR #75590)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/75590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement integral->complex casts (PR #75590)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/75590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement integral->complex casts (PR #75590)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -283,6 +283,28 @@ bool ByteCodeExprGen::VisitCastExpr(const CastExpr *CE) { case CK_ToVoid: return discard(SubExpr); + case CK_IntegralRealToComplex: + case CK_FloatingRealToComplex: { +// We're creating a complex value here, so we need to +// allocate stor

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -3767,6 +3767,57 @@ void DependentDecltypeType::Profile(llvm::FoldingSetNodeID &ID, E->Profile(ID, Context, true); } +PackIndexingType::PackIndexingType(const ASTContext &Context, + QualType Canonical, QualType Pattern, +

[clang] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-01-15 Thread Sam Tebbs via cfe-commits
https://github.com/SamTebbs33 updated https://github.com/llvm/llvm-project/pull/77936 >From bbc6c11cd3def5acbb2ba2f2ddc45df2c399f9d6 Mon Sep 17 00:00:00 2001 From: Samuel Tebbs Date: Wed, 10 Jan 2024 14:57:04 + Subject: [PATCH 1/3] [Clang][SME] Detect always_inline used with mismatched str

[clang] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -812,6 +819,23 @@ Address AArch64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, /*allowHigherAlign*/ false); } +void AArch64TargetCodeGenInfo::checkFunctionCallABI( +CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDec

[clang] [clang-format] Extract utility functions outside of test fixture (PR #78108)

2024-01-15 Thread via cfe-commits
mydeveloperday wrote: > > I don't understand why we need to refactor this? > > During the review for #77918 there was an ask to extract the refactor in a > separate PR. > > In #77918, I'm adding a couple new test fixtures and plan to use these > utility functions for verifying assumptions. A

[clang] [Clang][SME] Detect always_inline used with mismatched streaming attributes (PR #77936)

2024-01-15 Thread Sam Tebbs via cfe-commits
@@ -279,6 +279,8 @@ def err_builtin_needs_feature : Error<"%0 needs target feature %1">; def err_function_needs_feature : Error< "always_inline function %1 requires target feature '%2', but would " "be inlined into function %0 that is compiled without support for '%2'">; +

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s +// expected-no-diagnostics cor3ntin wrote: can you move that test to clang/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp ? https://github.com/llvm/llvm-projec

[clang] [llvm] [clang-tools-extra] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov updated https://github.com/llvm/llvm-project/pull/76804 >From d8598a382fb1496a96d6ff8317c06cf73606ad84 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Wed, 3 Jan 2024 11:07:17 +0100 Subject: [PATCH 1/4] [Format] Fix isStartOfName to recognize attributes This

[llvm] [lld] [clang-tools-extra] [lldb] [compiler-rt] [clang] [libcxx] [flang] [libcxxabi] [libc] [Flang][OpenMP] Push genEval calls to individual operations, NFC (PR #77758)

2024-01-15 Thread Krzysztof Parzyszek via cfe-commits
kparzysz wrote: Here's link to my comment about symbol table in the thread, followed by response from Valentin: https://discourse.llvm.org/t/openmp-lowering-from-pft-to-fir/75263/49 https://github.com/llvm/llvm-project/pull/77758 ___ cfe-commits maili

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/71315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -183,11 +178,7 @@ int32_t ByteCodeEmitter::getOffset(LabelTy Label) { return 0ull; } -bool ByteCodeEmitter::bail(const SourceLocation &Loc) { - if (!BailLocation) -BailLocation = Loc; - return false; -} +bool ByteCodeEmitter::bail(const SourceLocation &Loc) { return

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -54,36 +44,90 @@ bool Context::isPotentialConstantExpr(State &Parent, const FunctionDecl *FD) { bool Context::evaluateAsRValue(State &Parent, const Expr *E, APValue &Result) { assert(Stk.empty()); ByteCodeExprGen C(*this, *P, Parent, Stk, Result); - if (Check(Parent, C

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2024-01-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Looks mostly reasonable to me. https://github.com/llvm/llvm-project/pull/71315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add an EvaluationResult class (PR #71315)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -54,36 +44,90 @@ bool Context::isPotentialConstantExpr(State &Parent, const FunctionDecl *FD) { bool Context::evaluateAsRValue(State &Parent, const Expr *E, APValue &Result) { assert(Stk.empty()); ByteCodeExprGen C(*this, *P, Parent, Stk, Result); - if (Check(Parent, C

[clang] 5723fce - [Format] Fix isStartOfName to recognize attributes (#76804)

2024-01-15 Thread via cfe-commits
Author: Ilya Biryukov Date: 2024-01-15T14:57:05+01:00 New Revision: 5723fce088068cc91cf22e3a3da5700e213ce63e URL: https://github.com/llvm/llvm-project/commit/5723fce088068cc91cf22e3a3da5700e213ce63e DIFF: https://github.com/llvm/llvm-project/commit/5723fce088068cc91cf22e3a3da5700e213ce63e.diff

[clang] [clang-tools-extra] [llvm] [Format] Fix isStartOfName to recognize attributes (PR #76804)

2024-01-15 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov closed https://github.com/llvm/llvm-project/pull/76804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -4344,6 +4344,108 @@ class SizeOfPackExpr final } }; +class PackIndexingExpr final +: public Expr, + private llvm::TrailingObjects { + friend class ASTStmtReader; + friend class ASTStmtWriter; + friend TrailingObjects; + + SourceLocation EllipsisLoc; + + //

[llvm] [clang] [AArch64] Use parseArchExtension function. NFC (PR #78158)

2024-01-15 Thread Benjamin Kramer via cfe-commits
https://github.com/d0k approved this pull request. https://github.com/llvm/llvm-project/pull/78158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [libcxx] [compiler-rt] [lld] [libcxxabi] [lldb] [clang-tools-extra] [flang] [Flang][OpenMP] Push genEval calls to individual operations, NFC (PR #77758)

2024-01-15 Thread Krzysztof Parzyszek via cfe-commits
@@ -110,6 +110,34 @@ static void gatherFuncAndVarSyms( } } +static Fortran::lower::pft::Evaluation * +getCollapsedEval(Fortran::lower::pft::Evaluation &eval, int collapseValue) { kparzysz wrote: I'll make this change in another commit. https://github.com/l

[libc] [lldb] [libcxx] [compiler-rt] [libcxxabi] [lld] [clang-tools-extra] [clang] [flang] [llvm] [Flang][OpenMP] Push genEval calls to individual operations, NFC (PR #77758)

2024-01-15 Thread Krzysztof Parzyszek via cfe-commits
@@ -110,6 +110,34 @@ static void gatherFuncAndVarSyms( } } +static Fortran::lower::pft::Evaluation * +getCollapsedEval(Fortran::lower::pft::Evaluation &eval, int collapseValue) { + // Return the Evaluation of the innermost collapsed loop, or the current + // evaluation, if

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-15 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/77066 >From 3e0d0ab6c4fc6cba68285816a95e423bc18e8e55 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 5 Jan 2024 10:11:20 +0100 Subject: [PATCH 1/8] [coroutines] Detect lifetime issues with coroutine lambda captu

[flang] [clang] [libcxx] [lld] [llvm] [compiler-rt] [lldb] [clang-tools-extra] [libcxxabi] [libc] [Flang][OpenMP] Push genEval calls to individual operations, NFC (PR #77758)

2024-01-15 Thread Krzysztof Parzyszek via cfe-commits
https://github.com/kparzysz closed https://github.com/llvm/llvm-project/pull/77758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libc] [llvm] [libcxx] [compiler-rt] [lld] [libcxxabi] [lldb] [clang-tools-extra] [flang] [Flang][OpenMP] Handle SECTION construct from within SECTIONS (PR #77759)

2024-01-15 Thread Krzysztof Parzyszek via cfe-commits
https://github.com/kparzysz edited https://github.com/llvm/llvm-project/pull/77759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-01-15 Thread Mariya Podchishchaeva via cfe-commits
@@ -433,61 +433,86 @@ NarrowingKind StandardConversionSequence::getNarrowingKind( // -- from an integer type or unscoped enumeration type to an integer type //that cannot represent all the values of the original type, except where - //the source is a constant exp

[flang] [openmp] [clang] [libcxx] [lld] [llvm] [compiler-rt] [mlir] [libunwind] [lldb] [clang-tools-extra] [libcxxabi] [libc] [C23] Implement N3018: The constexpr specifier for object definitions (PR

2024-01-15 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: Ping. https://github.com/llvm/llvm-project/pull/73099 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -332,6 +332,22 @@ bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, return false; } +bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { + if (P

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -1006,13 +1008,18 @@ bool SetThisField(InterpState &S, CodePtr OpPC, uint32_t I) { template ::T> bool GetGlobal(InterpState &S, CodePtr OpPC, uint32_t I) { - const Block *B = S.P.getGlobal(I); - -

[clang] [clang][Interp] Add inline descriptor to global variables (PR #72892)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -332,6 +332,22 @@ bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, return false; } +bool CheckGlobalInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr) { + if (P

[clang] [clang] emit an error when the same identifier appears with both internal and external linkage in a translation unit (PR #78064)

2024-01-15 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: Note there is 39 failing clang tests in the CI https://buildkite.com/llvm-project/clang-ci/builds/9797#018d04dc-7b2b-47fb-8025-123227f7deab . https://github.com/llvm/llvm-project/pull/78064 ___ cfe-commits mailing list cfe-commits@l

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-15 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 updated https://github.com/llvm/llvm-project/pull/77066 >From 3e0d0ab6c4fc6cba68285816a95e423bc18e8e55 Mon Sep 17 00:00:00 2001 From: Utkarsh Saxena Date: Fri, 5 Jan 2024 10:11:20 +0100 Subject: [PATCH 1/9] [coroutines] Detect lifetime issues with coroutine lambda captu

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. Yeah I'm kind of a not aligned on this approach of hijacking what feels like the wrong setting, it feels complicated after the change which probably means we are not thinking about it enough about what people might reques

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
https://github.com/mydeveloperday edited https://github.com/llvm/llvm-project/pull/77918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -171,6 +187,31 @@ void DefinitionBlockSeparator::separateBlocks( return false; }; +// Separate License text. mydeveloperday wrote: Are we assuming any comment at the top of the file is a license comment? https://github.com/llvm/llvm-project

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -3853,46 +3853,51 @@ struct FormatStyle { /// Leave definition blocks as they are. SDS_Leave, /// Insert an empty line between definition blocks. -SDS_Always, +SDS_One, +/// Insert two empty lines between definition blocks. +SDS_Two, /// Remo

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -3853,46 +3853,51 @@ struct FormatStyle { /// Leave definition blocks as they are. SDS_Leave, /// Insert an empty line between definition blocks. -SDS_Always, +SDS_One, mydeveloperday wrote: 1) You cannot change Format.h without regenera

[clang] [clang][Interp] IndirectMember initializers (PR #69900)

2024-01-15 Thread Aaron Ballman via cfe-commits
@@ -198,6 +198,27 @@ bool ByteCodeStmtGen::visitFunc(const FunctionDecl *F) { return false; if (!this->emitInitPtrPop(InitExpr)) return false; + } else if (const IndirectFieldDecl *IFD = Init->getIndirectMember()) { +assert(IFD->getChai

[clang] [clang-format] Extract utility functions outside of test fixture (PR #78108)

2024-01-15 Thread via cfe-commits
seranu wrote: > Am I missing someone but how do you plan on using these functions if they are > in an anonymous namespace in the file and not part of a class where they are > static? maybe I missed something. I am planning to define other test fixtures in the same file. I need to do it as I w

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to this pull request. Just keep the tests simple. verifyFormat(this); verifyFormat(that); done! https://github.com/llvm/llvm-project/pull/77918 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -610,6 +626,113 @@ TEST_F(DefinitionBlockSeparatorTest, JavaScript) { "}", Style); } + +TEST_P(LicenseTest, SeparateLicenseFromBlock) { + constexpr StringRef LicenseSingleLineCommentStyle = {"// start license\n" +

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -610,6 +626,113 @@ TEST_F(DefinitionBlockSeparatorTest, JavaScript) { "}", Style); } + +TEST_P(LicenseTest, SeparateLicenseFromBlock) { + constexpr StringRef LicenseSingleLineCommentStyle = {"// start license\n" +

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
https://github.com/mydeveloperday edited https://github.com/llvm/llvm-project/pull/77918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -171,6 +187,31 @@ void DefinitionBlockSeparator::separateBlocks( return false; }; +// Separate License text. seranu wrote: Yes, that was my working assumption https://github.com/llvm/llvm-project/pull/77918 __

[clang] [clang-format] Separate License text and include blocks (PR #77918)

2024-01-15 Thread via cfe-commits
@@ -3853,46 +3853,51 @@ struct FormatStyle { /// Leave definition blocks as they are. SDS_Leave, /// Insert an empty line between definition blocks. -SDS_Always, +SDS_One, +/// Insert two empty lines between definition blocks. +SDS_Two, /// Remo

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/73017 >From 447aabfbf20c8d286caf6ad3f2e30da116592860 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Mon, 20 Nov 2023 18:03:18 + Subject: [PATCH 1/4] [APINotes] Upstream attributes that are created implicitly fr

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -301,6 +301,9 @@ class VariadicEnumArgument values, bit IsExternalType = isExternalType; } +// Represents an attribute wrapped by another attribute. +class AttrArgument : Argument; egorzhdan wrote: Makes sense to me! Renamed to `WrappedAttr` to match the

[clang] [clang][dataflow] Tighten checking for existence of a function body. (PR #78163)

2024-01-15 Thread via cfe-commits
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/78163 In various places, we would previously call `FunctionDecl::hasBody()` (which checks whether any redeclaration of the function has a body, not necessarily the one on which `hasBody()` is being called). This i

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -2601,6 +2604,22 @@ def SwiftError : InheritableAttr { let Documentation = [SwiftErrorDocs]; } +def SwiftImportAsNonGeneric : InheritableAttr { egorzhdan wrote: It is still used for `NSDictionary`, `NSSet` and friends in Foundation. https://github.com/l

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -2622,6 +2641,31 @@ def SwiftPrivate : InheritableAttr { let SimpleHandler = 1; } +def SwiftVersioned : Attr { egorzhdan wrote: Done, renamed it https://github.com/llvm/llvm-project/pull/73017 ___ cfe-commits

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -2622,6 +2641,31 @@ def SwiftPrivate : InheritableAttr { let SimpleHandler = 1; } +def SwiftVersioned : Attr { + // This attribute has no spellings as it is only ever created implicitly + // from API notes. + let Spellings = []; + let Args = [VersionArgument<"Version"

[clang] [clang][dataflow] Tighten checking for existence of a function body. (PR #78163)

2024-01-15 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/78163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Tighten checking for existence of a function body. (PR #78163)

2024-01-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: None (martinboehme) Changes In various places, we would previously call `FunctionDecl::hasBody()` (which checks whether any redeclaration of the function has a body, not necessarily the one on which `hasBody()` is being called). T

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/78159 >From f86766ff519ab2b802c0f1ac6c8138cbeadd543a Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 15 Jan 2024 14:30:18 +0100 Subject: [PATCH 1/2] [clang] Fix CTAD not work for function-type and array-type argum

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread Haojian Wu via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++20 %s +// expected-no-diagnostics hokein wrote: Sure, done. https://github.com/llvm/llvm-project/pull/78159 ___ cfe-commits mailing l

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -7539,74 +7559,65 @@ static NullabilityKind mapNullabilityAttrKind(ParsedAttr::Kind kind) { } } -/// Applies a nullability type specifier to the given type, if possible. -/// -/// \param state The type processing state. -/// -/// \param type The type to which the nullabi

[clang] [Clang][RISCV] Forward --no-relax option to linker for RISC-V (PR #76432)

2024-01-15 Thread Andreu Carminati via cfe-commits
https://github.com/andcarminati updated https://github.com/llvm/llvm-project/pull/76432 >From f697a90f8375a66fb23bbaaefc2e1297e79e063a Mon Sep 17 00:00:00 2001 From: Andreu Carminati Date: Mon, 15 Jan 2024 15:18:02 +0100 Subject: [PATCH] [Clang][RISCV] Forward --no-relax option to linker for RI

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-15 Thread via cfe-commits
@@ -1196,6 +1196,95 @@ void Parser::AnnotateExistingDecltypeSpecifier(const DeclSpec &DS, PP.AnnotateCachedTokens(Tok); } +SourceLocation Parser::ParseIndexedTypeNamePack(DeclSpec &DS) { + assert(Tok.isOneOf(tok::annot_indexed_pack_type, tok::identifier) && ---

[clang] [Clang][RISCV] Forward --no-relax option to linker for RISC-V (PR #76432)

2024-01-15 Thread Andreu Carminati via cfe-commits
andcarminati wrote: After approval, commits are now squashed to merge. https://github.com/llvm/llvm-project/pull/76432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Allow explicit specification of -lFortran_main (PR #78152)

2024-01-15 Thread Kiran Chandramohan via cfe-commits
@@ -1200,6 +1200,14 @@ static void addFortranMain(const ToolChain &TC, const ArgList &Args, // TODO: Find an equivalent of `--whole-archive` for Darwin and AIX. if (!isWholeArchivePresent(Args) && !TC.getTriple().isMacOSX() && !TC.getTriple().isOSAIX()) { +// Add

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -15139,6 +15139,37 @@ void Sema::DiagnoseSizeOfParametersAndReturnValue( } } +QualType Sema::AdjustParameterTypeForObjCAutoRefCount(QualType T, + SourceLocation NameLoc, +

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/73017 >From 447aabfbf20c8d286caf6ad3f2e30da116592860 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Mon, 20 Nov 2023 18:03:18 + Subject: [PATCH 1/4] [APINotes] Upstream attributes that are created implicitly fr

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -7519,6 +7519,26 @@ static bool HandleWebAssemblyFuncrefAttr(TypeProcessingState &State, return false; } +/// Rebuild an attributed type without the nullability attribute on it. +static QualType rebuildAttributedTypeWithoutNullability(ASTContext &Ctx, +

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -7519,6 +7519,26 @@ static bool HandleWebAssemblyFuncrefAttr(TypeProcessingState &State, return false; } +/// Rebuild an attributed type without the nullability attribute on it. +static QualType rebuildAttributedTypeWithoutNullability(ASTContext &Ctx, +

[clang] [APINotes] Upstream Sema logic to apply API Notes to decls (PR #73017)

2024-01-15 Thread Egor Zhdan via cfe-commits
@@ -7539,74 +7559,65 @@ static NullabilityKind mapNullabilityAttrKind(ParsedAttr::Kind kind) { } } -/// Applies a nullability type specifier to the given type, if possible. -/// -/// \param state The type processing state. -/// -/// \param type The type to which the nullabi

[clang] [coroutines][coro_lifetimebound] Detect lifetime issues with lambda captures (PR #77066)

2024-01-15 Thread Utkarsh Saxena via cfe-commits
@@ -33,6 +34,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Casting.h" usx95 wrote: Removed. https://github.com/llvm/llvm-project/pull/77066 _

[libc] [lldb] [libcxx] [compiler-rt] [libcxxabi] [lld] [clang-tools-extra] [clang] [flang] [llvm] [Flang][OpenMP] Push genEval calls to individual operations, NFC (PR #77758)

2024-01-15 Thread Krzysztof Parzyszek via cfe-commits
kparzysz wrote: Suggested changed made in https://github.com/llvm/llvm-project/commit/705d9273c5417e04dc542f0e46b90960c235c753. The buildkite times are really long now (7h on Friday), and I didn't want to delay merging of this PR by that much, plus the changes were really minor. https://githu

[libc] [lldb] [libcxx] [compiler-rt] [lld] [clang-tools-extra] [clang] [flang] [llvm] [IPSCCP] Variable not visible at Og: (PR #77901)

2024-01-15 Thread Carlos Alberto Enciso via cfe-commits
https://github.com/CarlosAlbertoEnciso updated https://github.com/llvm/llvm-project/pull/77901 >From cea029185ad219a4a0b6d03be00b0612675933ab Mon Sep 17 00:00:00 2001 From: Carlos Alberto Enciso Date: Fri, 12 Jan 2024 09:27:53 + Subject: [PATCH] [IPSCCP] Variable not visible at Og: https:/

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread via cfe-commits
@@ -645,4 +645,27 @@ namespace undefined_warnings { auto test2 = TemplDObj(.0f); } } + +namespace GH51710 { +template +struct A { + A(T f()) {} + A(int f(), T) {} + + A(T array[10]) {} + A(int array[10], T) {} cor3ntin wrote: Can you add tests for in

<    1   2   3   4   5   6   >