r352436 - [ASTImporter] Fix handling of overriden methods during ASTImport

2019-01-28 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Jan 28 13:55:33 2019 New Revision: 352436 URL: http://llvm.org/viewvc/llvm-project?rev=352436&view=rev Log: [ASTImporter] Fix handling of overriden methods during ASTImport Summary: When importing classes we may add a CXXMethodDecl more than once to a CXXRecordDecl when

r345784 - Revert "[ASTImporter][Structural Eq] Check for isBeingDefined"

2018-10-31 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Wed Oct 31 14:53:15 2018 New Revision: 345784 URL: http://llvm.org/viewvc/llvm-project?rev=345784&view=rev Log: Revert "[ASTImporter][Structural Eq] Check for isBeingDefined" This reverts commit r345760 because it caused an assertion in the lldb test suite. This is the log f

r355332 - [ASTImporter] Handle built-in when importing SourceLocation and FileID

2019-03-04 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Mar 4 12:25:54 2019 New Revision: 355332 URL: http://llvm.org/viewvc/llvm-project?rev=355332&view=rev Log: [ASTImporter] Handle built-in when importing SourceLocation and FileID Summary: Currently when we see a built-in we try and import the include location. Instead wh

r357100 - [ASTImporter] Fix IsStructuralMatch specialization for EnumDecl to prevent re-importing an EnumDecl while trying to complete it

2019-03-27 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Wed Mar 27 10:47:36 2019 New Revision: 357100 URL: http://llvm.org/viewvc/llvm-project?rev=357100&view=rev Log: [ASTImporter] Fix IsStructuralMatch specialization for EnumDecl to prevent re-importing an EnumDecl while trying to complete it Summary: We may try and re-import a

r357940 - [ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name instead of SearchName

2019-04-08 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Apr 8 13:50:21 2019 New Revision: 357940 URL: http://llvm.org/viewvc/llvm-project?rev=357940&view=rev Log: [ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name instead of SearchName Summary: https://reviews.llvm.org/D51633 added error handl

r359338 - [ASTImporter] Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition

2019-04-26 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Fri Apr 26 11:51:28 2019 New Revision: 359338 URL: http://llvm.org/viewvc/llvm-project?rev=359338&view=rev Log: [ASTImporter] Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition Summary: For a CXXRecordDecl the RecordDeclBits are stored in th

r368591 - [ASTDump] Add is_anonymous to VisitCXXRecordDecl

2019-08-12 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Mon Aug 12 10:07:49 2019 New Revision: 368591 URL: http://llvm.org/viewvc/llvm-project?rev=368591&view=rev Log: [ASTDump] Add is_anonymous to VisitCXXRecordDecl Summary: Adding is_anonymous the ASTDump for CXXRecordDecl. This turned out to be useful when debugging some probl

r361650 - [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name instead of SearchName

2019-05-24 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Fri May 24 09:53:44 2019 New Revision: 361650 URL: http://llvm.org/viewvc/llvm-project?rev=361650&view=rev Log: [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name instead of SearchName Summary: https://reviews.llvm.org/D51633 added error han

[clang] aa7ce60 - [Clang] Avoid crashes when parsing using enum declarations

2022-08-27 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-27T15:18:36-07:00 New Revision: aa7ce60536a642e825d26d89b4a4347a36b63360 URL: https://github.com/llvm/llvm-project/commit/aa7ce60536a642e825d26d89b4a4347a36b63360 DIFF: https://github.com/llvm/llvm-project/commit/aa7ce60536a642e825d26d89b4a4347a36b63360.dif

[clang] b9f7678 - [Clang] Fix lambda CheckForDefaultedFunction(...) so that it checks the CXXMethodDecl is a special member function before attempting to call DefineDefaultedFunction(...)

2022-08-30 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-30T18:08:44-07:00 New Revision: b9f767884669db0b5a56d87b0e8733614d8f884d URL: https://github.com/llvm/llvm-project/commit/b9f767884669db0b5a56d87b0e8733614d8f884d DIFF: https://github.com/llvm/llvm-project/commit/b9f767884669db0b5a56d87b0e8733614d8f884d.dif

[clang] 9f6b319 - [Clang] Fix lambda CheckForDefaultedFunction(...) so that it checks the CXXMethodDecl is not deleted before attempting to call DefineDefaultedFunction(...)

2022-09-02 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-09-02T18:59:15-07:00 New Revision: 9f6b3199d33c146937f29feb62e123f34138f770 URL: https://github.com/llvm/llvm-project/commit/9f6b3199d33c146937f29feb62e123f34138f770 DIFF: https://github.com/llvm/llvm-project/commit/9f6b3199d33c146937f29feb62e123f34138f770.dif

[clang] [Clang] Remove unneeded template keyword (PR #71435)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/71435 As noted in this bug report: https://github.com/llvm/llvm-project/issues/37647 Due to this clang bug we added the template keyword in Redeclarable.h. The bug has been fixed since then, so removing it. >From a743

[clang] [Clang] Remove unneeded template keyword (PR #71435)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/71435 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove unneeded template keyword (PR #71435)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Sadly this is failing on some build bots: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/62315/consoleFull#-3939952849ba4694-19c4-4d7e-bec5-911270d8a58c Not sure why at the moment. Will revert for now. https://github.com/llvm/llvm-project/pull/71435 ___

[clang] Revert "[Clang] Remove unneeded template keyword" (PR #71478)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/71478 Reverts llvm/llvm-project#71435 This is failing on some build bots e.g.: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/62315/consoleFull#-3939952849ba4694-19c4-4d7e-bec5-911270d8a58c >From 61934f800b

[clang] Revert "[Clang] Remove unneeded template keyword" (PR #71478)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/71478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2023-12-05 Thread Shafik Yaghmour via cfe-commits
@@ -179,3 +179,21 @@ void f() { #endif } } + +namespace GH71976 { +struct A { + int b = 5; + int foo() { +return [b = b]() { return b; }(); + } +}; + +struct B { + int a; + void foo() { +auto b = [a = this->a] { shafik wrote: ```suggestion aut

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2023-12-05 Thread Shafik Yaghmour via cfe-commits
@@ -179,3 +179,21 @@ void f() { #endif } } + +namespace GH71976 { +struct A { + int b = 5; + int foo() { +return [b = b]() { return b; }(); shafik wrote: ```suggestion return [b = b]() { return b; }(); // no diagnostic, init-capture does not shadow

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2023-12-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/74512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2023-12-05 Thread Shafik Yaghmour via cfe-commits
@@ -8395,10 +8395,11 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl *ShadowedDecl, unsigned WarningDiag = diag::warn_decl_shadow; SourceLocation CaptureLoc; - if (isa(D) && isa(ShadowedDecl) && NewDC && - isa(NewDC)) { + if (isa(D) && NewDC && isa(NewDC)) {

[clang] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2023-12-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM w/ minor comments https://github.com/llvm/llvm-project/pull/74512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Crash when referencing capture in static lambda (PR #74661)

2023-12-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think this makes sense but @cor3ntin should look at it. https://github.com/llvm/llvm-project/pull/74661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] bbb8a0d - [Clang] Fix ResolveConstructorOverload to not select a conversion function if we are going use copy elision

2023-12-08 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-12-08T09:38:59-08:00 New Revision: bbb8a0df7367068e1cf2fc54edd376beb976b430 URL: https://github.com/llvm/llvm-project/commit/bbb8a0df7367068e1cf2fc54edd376beb976b430 DIFF: https://github.com/llvm/llvm-project/commit/bbb8a0df7367068e1cf2fc54edd376beb976b430.dif

[clang] [Clang][Sema] Check the number of lambda non-concept tempate parameters (PR #74885)

2023-12-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This needs at least one test and a Release note. I expect the code form the issue to be well-formed: https://godbolt.org/z/bhdfG34xc So I am curious why you are adding the diagnostic for? https://github.com/llvm/llvm-project/pull/74885

[clang] [Clang][Sema] Print more static_assert exprs (PR #74852)

2023-12-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I don't feel like the changes are an improvement to the diagnostic but I would like to hear from others who focus on clang front-end reviews. https://github.com/llvm/llvm-project/pull/74852 ___ cfe-commits mailing

[clang] [clang][ASTImporter] Support Importer of BuiltinBitCastExpr (PR #74813)

2023-12-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please update the description to explain the problem in more details and why these changes fixes the problem. The description is what ends up in the git log and it is important that those logs provide enough information to understand the changes without having to view the

[clang] [clang][ASTImporter] Support Importer of BuiltinBitCastExpr (PR #74813)

2023-12-08 Thread Shafik Yaghmour via cfe-commits
@@ -7820,6 +7820,18 @@ ExpectedStmt ASTNodeImporter::VisitExplicitCastExpr(ExplicitCastExpr *E) { *ToLParenLocOrErr, OCE->getBridgeKind(), E->getCastKind(), *ToBridgeKeywordLocOrErr, ToTypeInfoAsWritten, ToSubExpr); } + case Stmt::BuiltinBitCastExprClass: {

[clang] [clang][Interp] Reject static lambdas with captures (PR #74718)

2023-12-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please add more details to the description so folks reading the git log know what the change is without having to do more digging. https://github.com/llvm/llvm-project/pull/74718 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [Clang][AST] Fix crash in APValue::LValueBase::getType when we have invalid decl (PR #75130)

2023-12-11 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/75130 In some cases when calling APValue::LValueBase::getType() when we have a ValueDecl in some cases we don't handle invalid decls. We iterating over redeclarations we reset the current decl to the current most recen

[clang] [Sema] Check nullness of captured type before use (PR #72230)

2023-11-14 Thread Shafik Yaghmour via cfe-commits
@@ -19773,6 +19773,8 @@ bool Sema::tryCaptureVariable( // declcontext can either capture the variable or have already captured // the variable. CaptureType = Var->getType(); + if (CaptureType.isNull()) shafik wrote: I am not sure this is the right fix.

[clang] [clang][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-11-16 Thread Shafik Yaghmour via cfe-commits
@@ -13540,6 +13540,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { CreateRecoveryExpr(Init->getBeginLoc(), Init->getEndLoc(), Args); if (RecoveryExpr.get()) VDecl->setInit(RecoveryExpr.get()); + // In general, f

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/72346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes some sense but I am not familiar enough with this area. https://github.com/llvm/llvm-project/pull/72346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-16 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -verify -fsyntax-only %s shafik wrote: Normally we put lone tests for a specific bug report in its own file e.g. GH70735.cpp for this case or we find a test that covers a similar area and put the test in a namespace named af

[clang] [clang] Reapply Handle templated operators with reversed arguments (PR #72213)

2023-11-16 Thread Shafik Yaghmour via cfe-commits
shafik wrote: So currently implementations differ here: https://godbolt.org/z/11331KW6e This feels related to [cwg2804](https://wg21.link/cwg2804) which is not live yet but can be found [here](https://cplusplus.github.io/CWG/issues/2804.html). I can find the discussion on this from Kona but we

[clang] [clang] Emit bad shift warnings (PR #70307)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -11773,7 +11786,25 @@ QualType Sema::CheckShiftOperands(ExprResult &LHS, ExprResult &RHS, isScopedEnumerationType(RHSType)) { return InvalidOperands(Loc, LHS, RHS); } - DiagnoseBadShiftValues(*this, LHS, RHS, Loc, Opc, LHSType); + + BadShiftValueKind BSVKind =

[clang] [NFC][Clang] Fix potential deref of end iterator (PR #70193)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -65,7 +65,7 @@ class CXXFieldCollector { /// getCurFields - Pointer to array of fields added to the currently parsed /// class. - FieldDecl **getCurFields() { return &*(Fields.end() - getCurNumFields()); } shafik wrote: I think this is basically [cwg2

[clang] [Sema] Fixed faulty shift count warning (PR #69521)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -12143,8 +12143,7 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, auto FXSema = S.Context.getFixedPointSemantics(LHSExprType); LeftSize = FXSema.getWidth() - (unsigned)FXSema.hasUnsignedPadding(); } - llvm::APInt LeftBits(Right.ge

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -3553,6 +3553,49 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl` +// we try to instantiate and update its explicit specifie

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -3682,6 +3725,17 @@ Sema::TemplateDeductionResult Sema::FinishTemplateArgumentDeduction( } } + // We skipped the instantiation of the explicit-specifier during subst the shafik wrote: This sentence is not super clear, can we spell out `subst` and `

[clang] [clang] Fix clang++ crash on assertions when compiling source (PR #70594)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify +// RUN: %clang_cc1 -fsyntax-only -std=c++23 %s -verify + +// expected-no-diagnostics + +struct A {}; +using CA = const A; + +struct S1 : CA { shafik wrote: These examples: https://godbolt.o

[clang] [clang] Fix clang++ crash on assertions when compiling source (PR #70594)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify shafik wrote: Normally if we add a new test just for a specific bug report we name it something like `GH35603.cpp` so we can readily identify the test is linked to github issue 35603. If w

[clang] [clang] Fix clang++ crash on assertions when compiling source (PR #70594)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -6431,7 +6431,7 @@ static bool HandleConstructorCall(const Expr *E, const LValue &This, // Non-virtual base classes are initialized in the order in the class // definition. We have already checked for virtual base classes. assert(!BaseIt->isVirtual() && "v

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-31 Thread Shafik Yaghmour via cfe-commits
@@ -3553,6 +3553,48 @@ static unsigned getPackIndexForParam(Sema &S, llvm_unreachable("parameter index would not be produced from template"); } +// if `Specialization` is a `CXXConstructorDecl` or `CXXConversionDecl`, +// we'll try to instantiate and update its explicit spec

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/70548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

2023-10-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. I just want to make sure we have enough testing in place for this change but overall I think I am happy. https://github.com/llvm/llvm-project/pull/70548 ___ cfe-commits mailing list cfe-commits@lis

[clang] [CodeGen] Revamp counted_by calculations (PR #70606)

2023-11-02 Thread Shafik Yaghmour via cfe-commits
@@ -966,9 +962,65 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } -FieldDecl *CodeGenFunction::FindCountedByField( -const Expr *Base, -LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel) { +const Expr * +CodeGenFunction

[clang] [CodeGen] Revamp counted_by calculations (PR #70606)

2023-11-02 Thread Shafik Yaghmour via cfe-commits
@@ -966,9 +962,65 @@ static llvm::Value *getArrayIndexingBound(CodeGenFunction &CGF, return nullptr; } -FieldDecl *CodeGenFunction::FindCountedByField( -const Expr *Base, -LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel) { +const Expr * +CodeGenFunction

[clang] Fix to attribute plugins reaching an unreachable (PR #70877)

2023-11-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please add a more detailed description of the problem and what the fix actually is. The description is what ends up in the git log and it is important that we have enough details there to understand the PR and what changes it makes. I do not see a test, can this fix be t

[clang] [Clang][AST] Fix crash in APValue::LValueBase::getType when we have invalid decl (PR #75130)

2023-12-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/75130 >From 8a169838778e333e6bf14a7156a6220d09b5818a Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 11 Dec 2023 18:35:57 -0800 Subject: [PATCH] [Clang][AST] Fix crash in APValue::LValueBase::getType when we

[clang] [Clang][AST] Fix crash in APValue::LValueBase::getType when we have invalid decl (PR #75130)

2023-12-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/75130 >From fb0ea87f212c78b5b39345e534a48b8956a19cc4 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 11 Dec 2023 18:35:57 -0800 Subject: [PATCH] [Clang][AST] Fix crash in APValue::LValueBase::getType when we

[clang] [clang] Fix CTAD not work for C++ explicit type conversion (functional annotation). (PR #75779)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please update your summary to explain the problem and how the fix addresses the problem. This is usually what goes into the git log and we want those to be as descriptive as possible but also it help code reviewers to understand what they are reviewing quicker. https://

[clang] [clang] Fix CTAD not work for C++ explicit type conversion (functional annotation). (PR #75779)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > > Why remove the support for ParenListExpr entirely? Could you not fallback > > on looking at the init list expression only when ParenListExpr is null? > > We could keep `ParenListExpr`, but I'm not sure the benefit (IMO, removing it > seems like an API improvement, and make co

[clang] [clang] Fix CTAD not work for C++ explicit type conversion (functional annotation). (PR #75779)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/75779 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix CTAD not respect default template arguments that were added after the definition. (PR #75569)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can we please add more detailed summaries, we want the git log to be sufficient for triaging various issues without having to dig into each commit individually. https://github.com/llvm/llvm-project/pull/75569 ___ cfe-commits mailing list

[clang] [clang] Fix CTAD not respect default template arguments that were added after the definition. (PR #75569)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
@@ -2061,13 +2070,13 @@ DeclResult Sema::CheckClassTemplate( if (!(TUK == TUK_Friend && CurContext->isDependentContext()) && CheckTemplateParameterList( TemplateParams, - PrevClassTemplate - ? PrevClassTemplate->getMostRecentDecl()->getTe

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

2023-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can we please have a more detailed summary for this PR? We rely on more detailed summaries in git logs. https://github.com/llvm/llvm-project/pull/75590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

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

2023-12-18 Thread Shafik Yaghmour 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][AST] Invalidate DecompositionDecl if it has invalid initializer. (PR #72428)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: We need a release note and please add a more detailed summary. A description of the problem being solved and the solution to the fix provides. https://github.com/llvm/llvm-project/pull/72428 ___ cfe-commits mailing

[clang] fix issue 73559. (PR #74926)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
@@ -641,6 +641,8 @@ Bug Fixes in This Version Fixes (`#67317 `_) - Clang now properly diagnoses use of stand-alone OpenMP directives after a label (including ``case`` or ``default`` labels). +- Fix crash when using C++ only

[clang] fix issue 73559. (PR #74926)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: In the future please add a more description title to your PR. Your summary is great though. Also in this case this is a clang and parser fix so you should prefix your title with `[Clang][Parser]` https://github.com/llvm/llvm-project/pull/74926 ___

[clang] [clang][Sema] Add -Wswitch-default warning option (PR #73077)

2023-12-18 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wswitch-default %s + +int f1(int a) { + switch (a) {// expected-warning {{'switch' missing 'default' label}} +case 1: a++; break; +case 2: a += 2; break; + } + return a; +} sha

[clang] [Clang][Sema] Fix Wswitch-default bad warning in template (PR #76007)

2023-12-19 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you add more details to you summary "https://github.com/llvm/llvm-project/pull/73077 added -Wswitch-default diagnostic but it produced false positives in templates. This PR will address that issue" https://github.com/llvm/llvm-project/pull/76007 ___

[clang] [Clang][Sema] Fix Wswitch-default bad warning in template (PR #76007)

2023-12-19 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wswitch-default %s shafik wrote: I think we can add these test to `clang/test/Sema/switch-default.c` https://github.com/llvm/llvm-project/pull/76007 __

[clang] [clang][sema] make sure arguments of __atomic_exchange complete type (PR #75135)

2023-12-19 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: We should add a release note for this change. https://github.com/llvm/llvm-project/pull/75135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Lex] Fix parsing of nested requirement to prevent flowing off the end of token stream (PR #73691)

2023-11-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/73691 Currently when parsing a nested requirement we attempt to balance parens if we have a parameter list. This will fail in some cases of ill-formed code and keep going until we fall off the token stream and crash. T

[clang] [Clang][Lex] Fix parsing of nested requirement to prevent flowing off the end of token stream (PR #73691)

2023-11-28 Thread Shafik Yaghmour via cfe-commits
@@ -3639,6 +3639,10 @@ ExprResult Parser::ParseRequiresExpression() { // TryParseParameterDeclarationClause). shafik wrote: I don't think the above fixme above is needed, I don't think there is any other way to handle this, at least based on so

[clang] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

2023-11-28 Thread Shafik Yaghmour via cfe-commits
@@ -482,8 +481,23 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc, } } } -// If typo correction failed or was not performed, fall through -[[fallthrough]]; +Result.suppressDiagnostics(); +return nullptr; + cas

[clang] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

2023-11-28 Thread Shafik Yaghmour via cfe-commits
@@ -482,8 +481,23 @@ ParsedType Sema::getTypeName(const IdentifierInfo &II, SourceLocation NameLoc, } } } -// If typo correction failed or was not performed, fall through -[[fallthrough]]; +Result.suppressDiagnostics(); +return nullptr; + cas

[clang] [Clang][Lex] Fix parsing of nested requirement to prevent flowing off the end of token stream (PR #73691)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/73691 >From 21d6bbdd1f8676e51b053ec3dd9020270e6b929e Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 28 Nov 2023 11:20:12 -0800 Subject: [PATCH] [Clang][Lex] Fix parsing of nested requirement to prevent flowi

[clang] [clang][NFC] Refactor expected directives in C++ DRs 1-99 (PR #73879)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/73879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor expected directives in C++ DRs 1-99 (PR #73879)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think I mostly like this direction. https://github.com/llvm/llvm-project/pull/73879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor expected directives in C++ DRs 1-99 (PR #73879)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
@@ -80,14 +86,21 @@ namespace dr5 { // dr5: 3.1 namespace dr7 { // dr7: 3.4 class A { public: ~A(); }; - class B : virtual private A {}; // expected-note 2 {{declared private here}} - class C : public B {} c; // expected-error 2 {{inherited virtual base class 'A' has priv

[clang] [Clang][Lex] Fix parsing of nested requirement to prevent flowing off the end of token stream (PR #73691)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/73691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Eagerly instantiate used constexpr function upon definition. (PR #73463)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you, LGTM https://github.com/llvm/llvm-project/pull/73463 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-11-29 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Was there an RFC asking the community about exposing lambdas in pre C++11 > modes? This is a sufficiently large language extension that we probably > should verify if we haven't already. I believe this is a conforming extension > (I can't think of a circumstance under which we'

[clang] [clang][NFC] Refactor expected directives in C++ DRs 1-99 (PR #73879)

2023-11-30 Thread Shafik Yaghmour via cfe-commits
@@ -80,14 +86,21 @@ namespace dr5 { // dr5: 3.1 namespace dr7 { // dr7: 3.4 class A { public: ~A(); }; - class B : virtual private A {}; // expected-note 2 {{declared private here}} - class C : public B {} c; // expected-error 2 {{inherited virtual base class 'A' has priv

[clang] [Clang] Implement P2308R1 - Template Parameter Initialization. (PR #73103)

2023-12-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/73103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2023-12-01 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you add a little more details in the description on the root cause of the bug? https://github.com/llvm/llvm-project/pull/74110 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang][ASTImporter] Fix import of variable template redeclarations. (PR #72841)

2023-12-01 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= Message-ID: In-Reply-To: @@ -5050,6 +5050,59 @@ TEST_P(ImportFriendClasses, RecordVarTemplateDecl) { EXPECT_EQ(ToTUX, ToX); } +TEST_P(ASTImporterOptionSpecificTestBase, VarTemplateDeclConflict) { + getToTuDecl( + R"( + template

[clang] [clang] Reject incomplete type arguments for __builtin_dump_struct (PR #72749)

2023-12-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM you should put the bug report in the problem description so it automatically links the PR and closes it when you merge it. https://github.com/llvm/llvm-project/pull/72749 ___ cfe-commits maili

[flang] [libcxx] [clang] [compiler-rt] [clang-tools-extra] [llvm] [Clang][Sema] Fix qualifier restriction of overriden methods (PR #71696)

2023-12-02 Thread Shafik Yaghmour via cfe-commits
@@ -18469,9 +18469,22 @@ bool Sema::CheckOverridingFunctionReturnType(const CXXMethodDecl *New, // The new class type must have the same or less qualifiers as the old type. - if (NewClassTy.isMoreQualifiedThan(OldClassTy)) { + if (!OldClassTy.isAtLeastAsQualifiedAs(NewCl

[flang] [libcxx] [clang] [compiler-rt] [clang-tools-extra] [llvm] [Clang][Sema] Fix qualifier restriction of overriden methods (PR #71696)

2023-12-02 Thread Shafik Yaghmour via cfe-commits
@@ -18469,9 +18469,22 @@ bool Sema::CheckOverridingFunctionReturnType(const CXXMethodDecl *New, // The new class type must have the same or less qualifiers as the old type. - if (NewClassTy.isMoreQualifiedThan(OldClassTy)) { + if (!OldClassTy.isAtLeastAsQualifiedAs(NewCl

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/71077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-12-03 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > > Can you add a release note? > > Do you think this small diagnostic wording change is worth noting in relnotes? Yes, we have a `Improvments to clang diagnostics` section. https://github.com/llvm/llvm-project/pull/71077 ___ cfe-commi

[clang] [clang] assert fail when number of arguments in pack exceed implement… (PR #74220)

2023-12-03 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Thanks for this PR! Emitting a diag in `TransformTemplateParmRefExpr` would > probably a better way to go about it. It's not clear to me that the assert` > is an improvement , and adding a diag would not be a lot more work. Would > that be something you would be willing to expl

[clang] [clang] assert fail when number of arguments in pack exceed implement… (PR #74220)

2023-12-03 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please make sure before you commit that you update the description with more details. This is what will show up in the git log and we want to make sure that is detailed enough to allow folks to debug build issues etc without having to examine each commit in detail. https://githu

[clang] Avoid printing overly large integer. (PR #75902)

2023-12-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > I agree with @tbaederr, fixing the underlying issue - either by optimizing > divide (good luck!) or printing in hexadecimal, seems like a better solution. > At the minimum, we should have a fixme comment to explain the restriction > > @tbaederr @erichkeane @shafik opinion? I a

[clang] [Clang][Parser] Fix crash of clang when using C++ constructs like :: in C code (PR #74926)

2023-12-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. If you have addressed all review comments and no one has asked you to wait to land the PR then you can land once you get an approval. https://github.com/llvm/llvm-project/pull/74926 ___ cfe-commits

[clang] [Clang][Sema] Fix Wswitch-default bad warning in template (PR #76007)

2023-12-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > For now I guess this is Ok, although I think the better fix would be to > diagnose missing or duplicate `default` labels even in the dependent case. > Because `default` labels themselves are never dependent. We should probably add a FIXME for this. https://github.com/llvm/llvm

[clang] [Sema] Add -Wc++11-narrowing-const-reference (PR #76094)

2023-12-20 Thread Shafik Yaghmour via cfe-commits
@@ -6158,12 +6158,24 @@ def err_illegal_initializer_type : Error<"illegal initializer type %0">; def ext_init_list_type_narrowing : ExtWarn< "type %0 cannot be narrowed to %1 in initializer list">, InGroup, DefaultError, SFINAEFailure; +// *_narrowing_const_reference diagn

[clang] [Sema] Fix crash on invalid code with parenthesized aggregate initialization (PR #76232)

2023-12-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This is missing a release note. https://github.com/llvm/llvm-project/pull/76232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] import InstantiatedFromMember of ClassTemplateSpecializationDecl (PR #76493)

2023-12-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM but I will let @balazske approve https://github.com/llvm/llvm-project/pull/76493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] import InstantiatedFromMember of ClassTemplateSpecializationDecl (PR #76493)

2023-12-28 Thread Shafik Yaghmour via cfe-commits
@@ -9342,6 +9342,38 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportConflictTypeAliasTemplate) { EXPECT_FALSE(ImportedCallable); } +AST_MATCHER(ClassTemplateSpecializationDecl, hasInstantiatedFromMember) { + if (auto Instantiate = Node.getInstantiatedFrom()) { +if (

[clang] [clang][ASTImporter] import InstantiatedFromMember of ClassTemplateSpecializationDecl (PR #76493)

2023-12-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/76493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-28 Thread Shafik Yaghmour via cfe-commits
@@ -979,6 +979,11 @@ bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New, if (isa(New) && New->getParent()->isDependentType()) return false; + // CWG1351: if either of the old function or the new function is defined as + // deleted, we don't need

[clang] [Clang][AST] Fix crash in APValue::LValueBase::getType when we have invalid decl (PR #75130)

2023-12-28 Thread Shafik Yaghmour via cfe-commits
@@ -70,11 +70,13 @@ QualType APValue::LValueBase::getType() const { // constexpr int *p = &arr[1]; // valid? // // For now, we take the most complete type we can find. -for (auto *Redecl = cast(D->getMostRecentDecl()); Redecl; +for (auto *Redecl = cast(D->ge

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Shafik Yaghmour via cfe-commits
@@ -345,15 +345,19 @@ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( using namespace TemplateInstArgsHelpers; const Decl *CurDecl = ND; + + if (!ND) +CurDecl = Decl::castFromDeclContext(DC); + if (Innermost) { Result.addOuterTemplateArgume

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Shafik Yaghmour via cfe-commits
@@ -345,15 +345,19 @@ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( using namespace TemplateInstArgsHelpers; const Decl *CurDecl = ND; + + if (!ND) shafik wrote: Can we also get a comment here why this makes sense to call `Decl::ca

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Shafik Yaghmour via cfe-commits
@@ -345,15 +345,19 @@ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( using namespace TemplateInstArgsHelpers; const Decl *CurDecl = ND; + + if (!ND) shafik wrote: Seems less error prone to check `!CurDecl` here. If the surrounding co

  1   2   3   4   5   6   7   >