[clang] [clang] always use resolved arguments for default argument deduction (PR #94756)

2024-06-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/94756 ___ 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-06 Thread Krystian Stasiowski via cfe-commits
@@ -1442,19 +1442,27 @@ SourceLocation CXXUnresolvedConstructExpr::getBeginLoc() const { CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr( const ASTContext , Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc

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

2024-06-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Hoping you can review this before your break! https://github.com/llvm/llvm-project/pull/92957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fixed grammatical error in "enum specifier" error msg #94443 (PR #94592)

2024-06-06 Thread Krystian Stasiowski via cfe-commits
@@ -6088,9 +6088,9 @@ def err_redefinition_different_concept : Error< "redefinition of concept %0 with different template parameters or requirements">; def err_tag_reference_non_tag : Error< "%select{non-struct type|non-class type|non-union type|non-enum " -

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

2024-06-04 Thread Krystian Stasiowski 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] [clang] NFCI: remove obsolete workaround for template default arguments (PR #94311)

2024-06-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian approved this pull request. LGTM 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] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-06-03 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: This does seem to cause an error in libstdc++: ``` include/c++/11/bits/shared_ptr.h:365:10: error: use 'template' keyword to treat '__shared_ptr' as a dependent template name this->__shared_ptr<_Tp>::operator=(__r); ^ ``` Since `this` is dependent (it's of

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

2024-06-03 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/92957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-06-03 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > > Per [[basic.lookup.qual.general] > > p1](http://eel.is/c++draft/basic.lookup.qual.general#1), lookup for a > > member-qualified name is type-only if it's an identifier followed by ::; > > Per my reading, type-only lookup is performed only for elaborated type >

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

2024-05-31 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane @shafik @Endilll (not sure if drafts send emails for review requests) https://github.com/llvm/llvm-project/pull/92957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-05-31 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I still need to add more comments and a release note, but this is otherwise functionally complete https://github.com/llvm/llvm-project/pull/92957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-05-31 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian ready_for_review https://github.com/llvm/llvm-project/pull/92957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-31 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I added support for unqualified lookup finding multiple declarations in the most recent commits, fixing the crash the currently happens on clang assertions trunk for the following ([godbolt link](https://godbolt.org/z/rEzo76qr5)): ```cpp inline namespace N { struct A { };

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

2024-05-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/93873 >From e638448bce1dd529acbf81592f324bdc1ecb3e19 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 28 May 2024 07:42:06 -0400 Subject: [PATCH 1/3] [Clang][Sema] Diagnose variable template explicit

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

2024-05-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mizvekov GCC seems to be right; [[decl.meaning.general] p3.3](eel.is/c++draft/dcl.meaning.general#3.3) requires that the specialized declaration be nominable (per [[basic.scope.scope] p7](eel.is/c++draft/basic.scope.scope#7)) in `S` (which in this case is the global

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

2024-05-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/93873 >From e638448bce1dd529acbf81592f324bdc1ecb3e19 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 28 May 2024 07:42:06 -0400 Subject: [PATCH 1/2] [Clang][Sema] Diagnose variable template explicit

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

2024-05-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/93873 According to [[temp.expl.spec] p2](http://eel.is/c++draft/temp.expl.spec#2): > The declaration in an _explicit-specialization_ shall not be an > _export-declaration_. An explicit specialization shall not use

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

2024-05-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92957 >From 616b2cf138f9b4a1f3a23db404f77c0603ad61e1 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 21 May 2024 13:15:24 -0400 Subject: [PATCH 1/2] [WIP][Clang] Implement resolution for CWG1835 ---

[clang] [Clang] Only non-overloaded dereference expressions are lvalues (PR #93457)

2024-05-27 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/93457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @kimgr The linked code seems to only be concerned with the `SourceLocation` of the `Decl` (which should be the same `SourceLocation` returned by `Decl::getLocation`), and the template arguments as written (which can be accessed via `getTemplateArgsAsWritten` per this patch).

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

2024-05-22 Thread Krystian Stasiowski 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] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-22 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zyn0217 Yes, both examples are of uninstantiable templates & are intended to be diagnosed by #90152. https://github.com/llvm/llvm-project/pull/89019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-05-21 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @Endilll I'm still in the process of writing tests, but I'll add several soon. I'm quite confident about my interpretation being correct but I just want to be 100% sure :). At the very least this patch gets [[basic.lookup.qual.general] example

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

2024-05-21 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92957 >From 4524db5ae7f3133b51328fbabd1f6188d7d3707b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 21 May 2024 13:15:24 -0400 Subject: [PATCH 1/2] [WIP][Clang] Implement resolution for CWG1835 ---

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

2024-05-21 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: (this PR is by no means complete, but I would like feedback regarding the validity of my interpretation of the DR resolution and perhaps some guidance with how to best go about implementing it. The currently included implementation _works_, but I'm uncertain whether it's the

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

2024-05-21 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92957 [CWG1835](https://cplusplus.github.io/CWG/issues/1835.html) was one of the many core issues resolved by [P1787R6: Declarations and where to find them](http://wg21.link/p1787r6). Its resolution changes how

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92449 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92449 >From f1a55b4f341990df2dc6edd740801486ca43488a Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 15:47:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not add implicit 'const' when

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Properly set the value category of dependent unary operators (PR #88740)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @cor3ntin ^ https://github.com/llvm/llvm-project/pull/88740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 697004547e8855787e7dd248508c9453b9df7e4d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/8] [Clang][Sema] Diagnose current instantiation used a

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From 72f0013122b764c7295a9b80b1f886b2eb38fb1d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/5] [Clang][Sema] Don't build

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92449 >From 0e73c984a4215207b2842f60ac4dcaeb63230407 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 15:47:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not add implicit 'const' when

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From 298b2fec54595e5c3c99070cbe856a36e1b71c95 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/5] [Clang][Sema] Don't build

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 4a535c2f2660583487018f421788cd2b88d8428d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/8] [Clang][Sema] Diagnose current instantiation used a

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 4a535c2f2660583487018f421788cd2b88d8428d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/7] [Clang][Sema] Diagnose current instantiation used a

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 613560033f7bf9acb9315766291bff07ee9e9b5f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when diagnosing near-match

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 4a535c2f2660583487018f421788cd2b88d8428d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/5] [Clang][Sema] Diagnose current instantiation used a

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 9d95d211797843f3dc612fe4340354b5fbf6a2fe Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/5] [Clang][Sema] Diagnose current instantiation used a

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From db264c719dfae25a536fb2452328d9aaeeea7b6f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/4] [Clang][Sema] Don't build

[clang] [Clang][Sema] Fix lookup of dependent operator= named by using-declaration (PR #91503)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Closing this for now; I'll return to this once we correctly handle dependent `operator=`. https://github.com/llvm/llvm-project/pull/91503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix lookup of dependent operator= named by using-declaration (PR #91503)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/91503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 187eb245484e21970ac55f05a78d3221f2f07f9a Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when diagnosing near-match

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(),

[clang] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92597 Consider the following: ```cpp template struct A { struct B : A { }; }; ``` According to [[class.derived.general] p2](http://eel.is/c++draft/class.derived.general#2): > [...] A _class-or-decltype_ shall

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 27fab1ec54259941e3ded174de18cd99aa89bf7e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when diagnosing near-match

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -724,6 +724,8 @@ Bug Fixes to C++ Support templates during partial ordering when deducing template arguments from a function declaration or when taking the address of a function template. - Fix a bug with checking constrained non-type template parameters for

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 27fab1ec54259941e3ded174de18cd99aa89bf7e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when diagnosing near-match

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -724,6 +724,8 @@ Bug Fixes to C++ Support templates during partial ordering when deducing template arguments from a function declaration or when taking the address of a function template. - Fix a bug with checking constrained non-type template parameters for

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(),

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
@@ -1527,20 +1527,20 @@ struct DeclaratorChunk { /// Retrieve the location of the 'const' qualifier. SourceLocation getConstQualifierLoc() const { - assert(MethodQualifiers); - return MethodQualifiers->getConstSpecLoc(); + return MethodQualifiers ?

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92452 >From 27fab1ec54259941e3ded174de18cd99aa89bf7e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 16:42:27 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when diagnosing near-match

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From 4ae259b21661caae2a9cd89437c56f3915195682 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/4] [Clang][Sema] Don't build

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(),

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
@@ -9203,15 +9203,15 @@ static NamedDecl *DiagnoseInvalidRedeclaration( << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType(); } else if (FDisConst != NewFDisConst) { - SemaRef.Diag(FD->getLocation(),

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
@@ -724,6 +724,8 @@ Bug Fixes to C++ Support templates during partial ordering when deducing template arguments from a function declaration or when taking the address of a function template. - Fix a bug with checking constrained non-type template parameters for

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92449 >From b56eeb2ef435f06764bac0b062a8a0e747f697d4 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 15:47:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not add implicit 'const' when

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92452 Clang crashes when diagnosing the following invalid redeclaration in C++11: ```cpp struct A { void f(); }; constexpr void A::f() { } // crash here ``` This happens because `DiagnoseInvalidRedeclaration`

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92449 >From b56eeb2ef435f06764bac0b062a8a0e747f697d4 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 15:47:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not add implicit 'const' when

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92449 Clang incorrectly accepts the following when using C++14 or later: ```cpp struct A { template void f() const; template<> constexpr void f(); }; ``` Non-static member functions declared `constexpr` are

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92425 >From c26365ef78366b5c200d085ddc4211db1b2054e0 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 10:59:03 -0400 Subject: [PATCH 1/3] [Clang][Sema] ASTContext::getUnconstrainedType

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92425 >From c26365ef78366b5c200d085ddc4211db1b2054e0 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 10:59:03 -0400 Subject: [PATCH 1/2] [Clang][Sema] ASTContext::getUnconstrainedType

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
@@ -723,6 +723,7 @@ Bug Fixes to C++ Support - Clang now ignores template parameters only used within the exception specification of candidate function templates during partial ordering when deducing template arguments from a function declaration or when taking the

[clang] Reapply "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92283)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @Caslyn [[expr.prim.this] p3](http://eel.is/c++draft/expr.prim.this#3) states: > [...] the expression this is a prvalue of type “pointer to _cv-qualifier-seq_ > `X`” wherever `X` is the current class [...] And [[over.match.oper] p1](http://eel.is/c++draft/over.match.oper#1)

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92425 >From c26365ef78366b5c200d085ddc4211db1b2054e0 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 10:59:03 -0400 Subject: [PATCH] [Clang][Sema] ASTContext::getUnconstrainedType

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/92425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92425 When the argument passed to `ASTContext::getUnconstrainedType` is an unconstrained `AutoType`, will return the argument unchanged. However, when called with a constrained `AutoType`, an unconstrained,

[clang] [Clang] Properly set the value category of dependent unary operators (PR #88740)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin I believe this causes the crash reported in #92275 https://github.com/llvm/llvm-project/pull/88740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Yeah, that seems incredibly reasonable and a much lower touch here with fewer > concerns about the side-effects that we got here. Should I open a PR then? https://github.com/llvm/llvm-project/pull/91842 ___ cfe-commits mailing

[clang] [clang] visit constraint of NTTP (PR #91842)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I don't think this is the right approach. I stepped though the example and the reason we reject is because: - We substitute a dependent `AutoType` in for the types of the template parameters when they are initially built. - We call `getMoreSpecialized` determine whether the

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From 6c8646dbb04cc5898fe7f67c9923036b2f68b56d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/3] [Clang][Sema] Don't build

[clang] Reapply "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92283)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Do not mark template parameters in the exception specification as used during partial ordering (PR #91534)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/91534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From a5ed54f967e4a15a80f41ee648f79e77202906d8 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/2] [Clang][Sema] Don't build

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92318 According to [[expr.prim.id.general] p2](http://eel.is/c++draft/expr.prim.id.general#2): > If an _id-expression_ `E` denotes a non-static non-type member of some class > `C` at a point where the current

[clang] Reapply "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92283)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: All the new changes are in 5ce0e969f3f94e9694545fe71b14fd8eb086f33e https://github.com/llvm/llvm-project/pull/92283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Do not mark template parameters in the exception specification as used during partial ordering (PR #91534)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/91534 >From 34af5511804b8c0fd8b0d742653f6017dd8e9e87 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 8 May 2024 08:43:23 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not mark template parameters in the

[clang] Reapply "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92283)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92283 This patch reapplies #90500, addressing a bug which caused binary operators with dependent operands to be incorrectly rebuilt by `TreeTransform`. >From 365d97508883eb5a4f9b898f8277d16e1f6d3862 Mon Sep 17

[clang] [Clang][Sema] Do not mark template parameters in the exception specification as used during partial ordering (PR #91534)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
@@ -5485,20 +5485,40 @@ static bool isAtLeastAsSpecializedAs(Sema , SourceLocation Loc, switch (TPOC) { case TPOC_Call: for (unsigned I = 0, N = Args2.size(); I != N; ++I) - ::MarkUsedTemplateParameters(S.Context, Args2[I], false, -

[clang] [Clang][Sema] Do not mark template parameters in the exception specification as used during partial ordering (PR #91534)

2024-05-15 Thread Krystian Stasiowski via cfe-commits
@@ -5485,20 +5485,40 @@ static bool isAtLeastAsSpecializedAs(Sema , SourceLocation Loc, switch (TPOC) { case TPOC_Call: for (unsigned I = 0, N = Args2.size(); I != N; ++I) - ::MarkUsedTemplateParameters(S.Context, Args2[I], false, -

[clang] [clang-tools-extra] Reapply "[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)" (PR #91393)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/91393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: The issue seems to be that `TreeTransform::RebuildCXXOperatorCallExpr` relies on `isOverloadableType` to always be true for dependent types https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Well this took forever to reduce: ```cpp template struct A; template bool operator==(const A&, const A&); template void f(int *x) { [&](auto *y) { return x == y; }; } void g() { f(nullptr); } ``` We initially build a `CXXOperatorCallExpr` during parsing for the

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Reverted in #92149 https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92149)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/92149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92149)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92149 >From 55a5910281b9f6e150adc29b3a1b9c149ca0ef55 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 14 May 2024 13:17:29 -0400 Subject: [PATCH] Revert "[Clang][Sema] Earlier type checking for builtin

[clang] Revert "[Clang][Sema] Earlier type checking for builtin unary operators (#90500)" (PR #92149)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92149 This reverts commit 8019cc94658d133583f7be6cd0023d30b0f3. >From a55eb47a72fd6b5d703e7c20e2cbf5b2aa7fd78d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 14 May 2024 13:17:29 -0400 Subject:

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: This seems to [break something](https://lab.llvm.org/buildbot/#/builders/121/builds/41631) in LLVM... investigating https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Since I addressed @shafik's comments, it this good to be merged? https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/92113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-13 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @eaeltsin @ilya-biryukov Fixed in 596a9c1f9b3179b3c77cbde1e96619292ce2a10a https://github.com/llvm/llvm-project/pull/90152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/91972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/91972 >From a013806c0199e260c37bc6b16b600e61e4caa1c9 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 13 May 2024 10:22:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix bug where operator-> typo

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > I think this needs a release note? I know the only case we have right now is > because of your other patch, but perhaps this affects elsewhere too? @erichkeane I don't think we need a release note since the code changes are in `LookupMemberExpr`, which prior to #90152 had

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/91972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix bug where operator-> typo corrects in the current instantiation (PR #91972)

2024-05-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/91972 >From a013806c0199e260c37bc6b16b600e61e4caa1c9 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 13 May 2024 10:22:04 -0400 Subject: [PATCH] [Clang][Sema] Fix bug where operator-> typo corrects in

  1   2   3   4   5   6   7   8   >