Skip to content

Ignores dependent base classes using qualified lookup in definition context #13826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RealLitb mannequin opened this issue Jul 25, 2012 · 5 comments · Fixed by #73018
Closed

Ignores dependent base classes using qualified lookup in definition context #13826

RealLitb mannequin opened this issue Jul 25, 2012 · 5 comments · Fixed by #73018
Labels
bugzilla Issues migrated from bugzilla c++11 clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party rejects-valid

Comments

@RealLitb
Copy link
Mannequin

RealLitb mannequin commented Jul 25, 2012

Bugzilla Link 13454
Version trunk
OS Windows NT
CC @DougGregor

Extended Description

This should work fine, but Clang doesn't accept the absence of "typename" in the definition of "B"

template<typename T> struct A { 
   typedef int type; 
   struct B; 
}; 

template<typename T> struct A<T>::B : A<T> { 
   B::type t; 
};
@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Endilll
Copy link
Contributor

Endilll commented Nov 3, 2023

We still reject this as of Clang 17, while other implementations accept: https://godbolt.org/z/zMhczK3hh

@Endilll Endilll added the confirmed Verified by a second party label Nov 3, 2023
@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" rejects-valid labels Nov 3, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 3, 2023

@llvm/issue-subscribers-clang-frontend

Author: None (be579e8c-b74b-475b-a126-3b8cefdd833c)

| | | | --- | --- | | Bugzilla Link | [13454](https://llvm.org/bz13454) | | Version | trunk | | OS | Windows NT | | CC | @DougGregor |

Extended Description

This should work fine, but Clang doesn't accept the absence of "typename" in the definition of "B"

template<typename T> struct A {
typedef int type;
struct B;
};

template<typename T> struct A<T>::B : A<T> {
B::type t;
};

@shafik
Copy link
Collaborator

shafik commented Nov 4, 2023

Confirmed

@shafik
Copy link
Collaborator

shafik commented Nov 4, 2023

CC @Fznamznon

Fznamznon added a commit to Fznamznon/llvm-project that referenced this issue Nov 21, 2023
Due to d0d2ee0 clang doesn't perform qualified
name lookup into the current instantiation when it has dependent bases, because
of that `getTypeName` call always returns null for unknown specialization case.
When there is a `typename` keyword, `DependentNameType` is constructed instead
of simply returning null.
This change attempts to do the same in case of `typename` absence.

Fixes llvm#13826
@Fznamznon
Copy link
Contributor

CC @Fznamznon

I'm not sure but here is #73018

Fznamznon added a commit that referenced this issue Nov 30, 2023
…on (#73018)

Due to d0d2ee0 clang doesn't perform
qualified name lookup into the current instantiation when it has
dependent bases, because of that `getTypeName` call always returns null
for unknown specialization case. When there is a `typename` keyword,
`DependentNameType` is constructed instead of simply returning null.
This change attempts to do the same in case of `typename` absence.

Fixes #13826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++11 clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party rejects-valid
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants