Skip to content

[clang]not lookup name containing a dependent type #77587

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,9 @@ Bug Fixes in This Version
- Clang now emits correct source location for code-coverage regions in `if constexpr`
and `if consteval` branches.
Fixes (`#54419 <https://github.com/llvm/llvm-project/issues/54419>`_)

- Fix an issue where clang cannot find conversion function with template
parameter when instantiation of template class.
Fixes (`#77583 <https://github.com/llvm/llvm-project/issues/77583>`_)

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaExprMember.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,8 @@ Sema::BuildMemberReferenceExpr(Expr *Base, QualType BaseType,
const Scope *S,
ActOnMemberAccessExtraArgs *ExtraArgs) {
if (BaseType->isDependentType() ||
(SS.isSet() && isDependentScopeSpecifier(SS)))
(SS.isSet() && isDependentScopeSpecifier(SS)) ||
NameInfo.getName().isDependentName())
return ActOnDependentMemberExpr(Base, BaseType,
IsArrow, OpLoc,
SS, TemplateKWLoc, FirstQualifierInScope,
Expand Down
25 changes: 17 additions & 8 deletions clang/test/SemaCXX/conversion-function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,22 @@ struct S {

#if __cplusplus >= 201103L
namespace dependent_conversion_function_id_lookup {
template<typename T> struct A {
operator T();
};
template<typename T> struct B : A<T> {
template<typename U> using Lookup = decltype(&B::operator U);
};
using Result = B<int>::Lookup<int>;
using Result = int (A<int>::*)();
namespace gh77583 {
struct A1 {
operator int();
};
template<class T> struct C {
template <typename U> using Lookup = decltype(T{}.operator U());
};
C<A1> v{};
}
template<typename T> struct A2 {
operator T();
};
template<typename T> struct B : A2<T> {
template<typename U> using Lookup = decltype(&B::operator U);
};
using Result = B<int>::Lookup<int>;
using Result = int (A2<int>::*)();
}
#endif