[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-06-01 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > This means that we must perform the second (unqualified) lookup during > parsing even when the type of the object expression is dependent, but those > results are not used to determine whether a < token is the start of a > template-argument_list; they are stored so we can

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

2024-06-01 Thread Vlad Serebrennikov via cfe-commits
Endilll 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 specifiers

[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 via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-coroutines Author: Krystian Stasiowski (sdkrystian) Changes [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

[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] 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] Implement resolution for CWG1835 (PR #92957)

2024-05-24 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] [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] Implement resolution for CWG1835 (PR #92957)

2024-05-21 Thread Matheus Izvekov via cfe-commits
@@ -618,7 +618,6 @@ namespace cwg141 { // cwg141: 3.1 // FIXME: we issue a useful diagnostic first, then some bogus ones. mizvekov wrote: It looks like this FIXME is fixed as per change below. https://github.com/llvm/llvm-project/pull/92957

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

2024-05-21 Thread Matheus Izvekov via cfe-commits
@@ -2893,6 +2893,8 @@ class TreeTransform { CXXScopeSpec SS; SS.Adopt(QualifierLoc); +if (FirstQualifierInScope) + SS.setFoundFirstQualifierInScope(FirstQualifierInScope); mizvekov wrote: It looks like adding 'FirstQualifierInScope' as a

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

2024-05-21 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] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-21 Thread Matheus Izvekov via cfe-commits
@@ -397,22 +397,32 @@ NamedDecl *Sema::FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS) { while (NNS->getPrefix()) NNS = NNS->getPrefix(); - if (NNS->getKind() != NestedNameSpecifier::Identifier) -return nullptr; - - LookupResult Found(*this,

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

2024-05-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov 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-05-21 Thread Matheus Izvekov via cfe-commits
@@ -720,7 +720,7 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration( return nullptr; } CXXScopeSpec SS; -if (ParseOptionalCXXScopeSpecifier(SS, /*ParsedType=*/nullptr, +if (ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/nullptr,

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

2024-05-21 Thread Matheus Izvekov via cfe-commits
@@ -6891,7 +6891,7 @@ class Sema final : public SemaBase { const TemplateArgumentListInfo *TemplateArgs); ExprResult ActOnMemberAccessExpr(Scope *S, Expr *Base, SourceLocation OpLoc, - tok::TokenKind OpKind, CXXScopeSpec , +

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

2024-05-21 Thread Matheus Izvekov via cfe-commits
@@ -47,8 +47,8 @@ template void DerivedT::Inner() { Derived1T::Foo(); Derived2T::Member = 42; - this->Derived1T::Foo(); - this->Derived2T::Member = 42; + this->Derived1T::Foo(); // expected-error{{use 'template' keyword to treat 'Derived1T' as a dependent template

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

2024-05-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I think overall this looks like the right direction to me. 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-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 Vlad Serebrennikov via cfe-commits
Endilll wrote: It was a pure accident I opened this PR. I think draft status does a good job at silencing notifications. I spend a decent amount of time in P1787R6, so I might be able to provide good feedback. I'll take a look tomorrow. It would be nice to see a test for CWG1835 among the

[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