[clang] [Clang][Sema] Diagnose variable template explicit specializations with storage-class-specifiers (PR #93873)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Interestingly, only GCC errors on a case like this: ``` namespace { template int A = 0; } template<> int A = 0; ``` https://godbolt.org/z/TTjssKxz5 https://github.com/llvm/llvm-project/pull/93873 ___ cfe-commi

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/93926 This change was missed in #93433. >From dd8839b4f3294241b2a6df8bc10e869176baff72 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 31 May 2024 02:53:18 -0300 Subject: [PATCH] [clang] AST Visitor: skip e

[clang] [libcxx] [clang] Preserve Qualifiers and type sugar in TemplateNames (PR #93433)

2024-05-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @pcc https://github.com/llvm/llvm-project/pull/93926 should fix it, can you double check that it gets all issues? https://github.com/llvm/llvm-project/pull/93433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93926 >From db56ac3130164f570942d54686ffb39cf7d2ae33 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 31 May 2024 02:53:18 -0300 Subject: [PATCH] [clang] AST Visitor: skip empty qualifiers in QualifiedTempla

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/93926 >From 55d946648a44e7a0b2fc45d20866f29ef4528c15 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 31 May 2024 02:53:18 -0300 Subject: [PATCH] [clang] AST Visitor: skip empty qualifiers in QualifiedTempla

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-30 Thread Matheus Izvekov via cfe-commits
@@ -855,10 +855,14 @@ bool RecursiveASTVisitor::TraverseDeclarationNameInfo( template bool RecursiveASTVisitor::TraverseTemplateName(TemplateName Template) { - if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) + if (DependentTemplateName *DTN = Templ

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-31 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/93926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-31 Thread Matheus Izvekov via cfe-commits
@@ -855,10 +855,14 @@ bool RecursiveASTVisitor::TraverseDeclarationNameInfo( template bool RecursiveASTVisitor::TraverseTemplateName(TemplateName Template) { - if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) + if (DependentTemplateName *DTN = Templ

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-05-31 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/93926 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] AST Visitor: skip empty qualifiers in QualifiedTemplateName (PR #93926)

2024-06-03 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Even with this fix, I'm seeing a segfault in clang/lib/AST/QualTypeNames.cpp > at line 216. > I have a fix in testing that adds this check, but if you would double check > it after it goes in, that would be helpful. > > Unfortunately the failure is in an internal tool, agains

[clang] [clang] NFCI: remove obsolete workaround for template default arguments (PR #94311)

2024-06-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/94311 This removes a workaround for template template arguments pointing to older template declarations, which don't have the most recent default argument definition. The removed workaround was introduced in 1abacf

[clang] [clang] NFCI: remove obsolete workaround for template default arguments (PR #94311)

2024-06-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/94311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-06-04 Thread Matheus Izvekov via cfe-commits
@@ -55,15 +55,21 @@ namespace PR11856 { template T *end(T*); - class X { }; + struct X { }; + struct Y { +int end; + }; template void Foo2() { T it1; -if (it1->end < it1->end) { -} +if (it1->end < it1->end) { } X *x; -if (x->end <

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

2024-06-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I think it makes a lot of sense for lldb to have a precommit CI pipeline > which tests changes to lldb. I don't think we're at a point where it would > make sense to enable lldb precommit CI testing for changes to clang, though. > > For starters, the false positive rate from

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Minor nit, otherwise LGTM. https://github.com/llvm/llvm-project/pull/81662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/81662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-15 Thread Matheus Izvekov via cfe-commits
@@ -3453,6 +3453,10 @@ ExprResult Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS, NeedsADL, R.isOverloadedResult(), R.begin(), R.end()); + if (ULE && R.isSingleResult() && R.getFoundDecl()->isInvali

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/81662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-15 Thread Matheus Izvekov via cfe-commits
@@ -1070,57 +1077,24 @@ class Sema; }; private: -SmallVector Candidates; -llvm::SmallPtrSet Functions; - -// Allocator for ConversionSequenceLists. We store the first few of these -// inline to avoid allocation for small sets. -llvm::BumpPtrAllocator

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-16 Thread Matheus Izvekov via cfe-commits
@@ -1070,57 +1077,24 @@ class Sema; }; private: -SmallVector Candidates; -llvm::SmallPtrSet Functions; - -// Allocator for ConversionSequenceLists. We store the first few of these -// inline to avoid allocation for small sets. -llvm::BumpPtrAllocator

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/89096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I think it would be a good idea to double check this for performance regressions, since this case will recurse into the function every time with this patch. Though I don't know if there is a better way to test it than to merge it and wait for it to be pic

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3649,19 +3649,15 @@ class IsTypeDeclaredInsideVisitor /// This function checks if the function has 'auto' return type that contains /// a reference (in any way) to a declaration inside the same function. mizvekov wrote: ```suggestion /// This function che

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I tested this idea, might be like this: I meant something else. This patch makes it so the delayed function type importation happens unconditionally. I was aware that change would cause breakages. What I meant is that, we have a special sugar type node that marks deduction,

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/89096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-18 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,28 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a declara

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @term-est It would be helpful if you could post the surrounding code context where this crashed, This is pointed at the top of the stacktrace: ``` 0. /home/est/Working-Directory/DS/wetend-emulator-new/WetendEmulator.hpp:85:128: current parser token ')' ``` You said, and I

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
@@ -13435,16 +13435,18 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if (

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13458,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +ExprResult Recovery = +CreateRecoveryExpr(Init->getBeginLoc(), In

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov deleted https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-21 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13458,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +ExprResult Recovery = +CreateRecoveryExpr(Init->getBeginLoc(), In

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] [Sema] Support MSVC non-const lvalue to user-defined temporary reference (PR #99833)

2024-07-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/99833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix assertion failure during conversion function overload resolution. (PR #98671)

2024-07-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > That said... an example like the following sidesteps all these issues and > still crashes clang, so I think the above comments are somewhat orthogonal to > this patch (except that I think we should have something like this as a test > case instead of the current test case): >

[clang] Avoid accessing unset optional, workaround for #100095 (PR #100408)

2024-07-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I don't believe we currently have any code coverage at all for the line affected. So with this change, which we don't fully understand, we could be breaking currently working code, and we could not even be fixing the known broken cases, as there could be further UB down the li

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/100692 This makes partial ordering of function templates consistent with other entities. Fixes #18291 >From 90d77efa0a4ffacdb7ba5ad4403d77822742a255 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 497d0c668a7303ac45d4d589221976c23c476f3f Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 04cbc865505824fec9eae463ab2172bc6fa64b24 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From c7ef00e6b9b2c798ef002696be6ebe65195d2fab Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] Fix #99858 (PR #99859)

2024-07-26 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: My impression is that in this case, the Decl is supposed to be instantiated here, so in valid code, a instantiation would be found, so strictly speaking the null check would not be the right thing. But we do have cases where we don't instantiate in case the Decl is invalid. In

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-26 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @AaronBallman @cor3ntin @mizvekov So, I've made improvements to our > implementation of `isTemplateArgumentList` (not on this branch) that allow us > to issue a warning instead of an error for most of the cases where applying > the DR breaks existing code: > That's great, t

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -30,98 +30,27 @@ class basic_string_view { constexpr basic_string_view &operator=(const basic_string_view &) {} }; -template -constexpr bool operator<(basic_string_view, basic_string_view) { - return {}; -} -template -constexpr bool operator<(type_identity_t>, -

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info); ---

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -859,8 +861,10 @@ class PackDeductionScope { // by this pack expansion, then clear out the deduction. DeducedFromEarlierParameter = !Deduced[Index].isNull(); DeducedPack Pack(Index); -Pack.Saved = Deduced[Index]; -Deduced[Index] = TemplateArgument(); +

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5425,34 +5534,112 @@ static bool isAtLeastAsSpecializedAs(Sema &S, SourceLocation Loc, // the partial ordering is done: TemplateDeductionInfo Info(Loc); switch (TPOC) { - case TPOC_Call: + case TPOC_Call: { if (DeduceTemplateArguments(S, TemplateParams, Args

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 1aa99ba557fd563dc55c9cd4c6d8ce7f05b3bd6d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Building abseil-cpp with the new Clang runs into errors. Are they expected? Did you test the version I just pushed 25 minutes ago? I believe these particular breakages should be fixed there. We just implemented a rule change to account for the string_view failures, but in an

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Building abseil-cpp with the new Clang runs into errors. Are they expected? Nevermind, that's a different failure. Still investigating. https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 89e016886fd87ab54856ed61a0a419d25f7df9e5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @MaskRay the latest version fixes libc++ regressions. Also abseil-cpp builds correctly on MacOS, according to those instructions. https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext &Context, return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema &S, FunctionTemplateDecl *FTD, int ArgIdx, QualType P, Qu

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info); ---

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -767,6 +757,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, else Diag(IdInfo.IdentifierLoc, diag::err_undeclared_var_use) << IdInfo.Identifier; +#endif mizvekov wrote: You should probably remove these before

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -698,13 +685,15 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, if (ErrorRecoveryLookup) return true; +#if 0 // If we didn't find anything during our lookup, try again with // ordinary name lookup, which can help us produce bette

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 89e5db41f3d3bc939078b63d43b7181bfc765fd1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering fu

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It doesn't seem like elide-constructors is wired to control this behavior. Seems to be wired only to the StaticAnalyzer presently. Regardless, the decision where to apply NRVO is currently centralized in SemaStmt. I think "Sema::getNamedReturnInfo(const VarDecl *VD)" would be

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I agree it's strange choice the effects of elide-constructor are applied on the CodeGen side, by ignoring the AST, instead of on the AST directly. https://github.com/llvm/llvm-project/pull/101038 ___ cfe-commits mailing list cfe-commit

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: >From my testing in compiler explorer, GCC and Clang always produce programs >that return 1 as far back as we can test. ICC and MSVC do otherwise, they return 0. So I think this supports the notion that this should be a dialect, and we have to wire defaults differently in MSVC

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I doubt anyone is intentionally depending on equality here. > The difference wrt the gnu::cleanup behavior looks plausible: https://github.com/llvm/llvm-project/issues/100868 https://github.com/llvm/llvm-project/pull/101038 ___ cf

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Nice! Please keep track and let us know which parts we haven't seen and have important changes we need to pay more attention to during re-review. Otherwise the patch is getting quite big already :) https://github.com/llvm/llvm-project/pull/100425 __

[clang] [clang] Add deprecation warning for `-Ofast` driver option (PR #98736)

2024-07-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/98736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix assertion failure during conversion function overload resolution. (PR #98671)

2024-07-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM as well https://github.com/llvm/llvm-project/pull/98671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-17 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-17 Thread Matheus Izvekov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-17 Thread Matheus Izvekov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/98622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: LGTM, Thanks! https://github.com/llvm/llvm-project/pull/98622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -23,3 +23,104 @@ namespace PR41576 { } static_assert(f(3, 4) == 6); // expected-note {{instantiation}} } + +namespace PR85667 { + +template +struct identity { + using type = T; +}; + +template void f() { + + static_assert([](Is... x) { +return ([I(x)] { + re

[clang] [Sema] Preserve ContainsUnexpandedParameterPack in TransformLambdaExpr (PR #86265)

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -14636,6 +14645,20 @@ TreeTransform::TransformLambdaExpr(LambdaExpr *E) { /*IsInstantiation*/ true); SavedContext.pop(); + // Parts other than the capture e.g. the lambda body might still contain a + // pattern that an outer fold exp

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/98788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Just a couple of nits, I will do a more comprehensive review later. https://github.com/llvm/llvm-project/pull/98788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -980,19 +986,69 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate) { return {Template, AliasRhsTemplateArgs}; } +// Build the type for a deduction guide generated from an inherited constructor +// [over.match.class.deduct]p1.10: +// ... the

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -1254,8 +1341,221 @@ void DeclareImplicitDeductionGuidesForTypeAlias( ->getDeductionCandidateKind() == DeductionCandidate::Aggregate) continue; -BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc); +BuildDeductionGuideForTypeAlias(SemaR

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-19 Thread Matheus Izvekov via cfe-commits
@@ -1254,8 +1341,221 @@ void DeclareImplicitDeductionGuidesForTypeAlias( ->getDeductionCandidateKind() == DeductionCandidate::Aggregate) continue; -BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc); +BuildDeductionGuideForTypeAlias(SemaR

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > WDYAT? We generally try to avoid issuing more than one error diagnostic for the same problem. Couldn't we instead issue a note `note: maybe missing 'template' keyword prior to dependent template name 'A'` attached to the first error instead? https://github.com/llvm/llvm-pro

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Another option would be to apply the resolution to all modes, but recover and issue a warning instead of an error. How feasible would that be? https://github.com/llvm/llvm-project/pull/98547 ___ cfe-commits mailing list cfe-commits@lis

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM as well. https://github.com/llvm/llvm-project/pull/97619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov Without unannotated tentative parsing (to be _properly_ introduced > by #96364), issuing a warning is infeasible. Either way, by the time we > detect the error we could be who knows how deep into the second operand of a > `>` operator. So when we are parsing `this-

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > We already do that :) the problem is when what follows `A` _doesn't_ > unambiguously look like a template argument list: Sure, but before CWG1835, we would perform the lookup anyway and treat the `<0>` as a template argument list, even if it isn't unambiguously a template ar

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I am also seeing breakages which are solved by reverting this change. The failure occurs when importing modules from within header files: ``` error: expected a module name after 'import' 11 | import std; ``` https://github.com/llvm/llvm-project/pull/90574 ___

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I don't think I'll be able to provide a reproducer today. Regardless, bugs in modules are in general not easy to reduce. Unless you think you can fix this soon enough, I think a revert is appropriate here. https://github.com/llvm/llvm-project/pull/90574

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