-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[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
[clang]not lookup name containing a dependent type #77587
Conversation
@llvm/pr-subscribers-clang Author: Congcong Cai (HerrCai0907) ChangesFixes: #77583 Full diff: https://github.com/llvm/llvm-project/pull/77587.diff 2 Files Affected:
diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp
index 2abec3d86a27d9..32998ae60eafe2 100644
--- a/clang/lib/Sema/SemaExprMember.cpp
+++ b/clang/lib/Sema/SemaExprMember.cpp
@@ -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,
diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp
index b6e6142d179066..220ae78f2d8246 100644
--- a/clang/test/SemaCXX/conversion-function.cpp
+++ b/clang/test/SemaCXX/conversion-function.cpp
@@ -475,13 +475,21 @@ struct S {
#if __cplusplus >= 201103L
namespace dependent_conversion_function_id_lookup {
- template<typename T> struct A {
+ 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 : A<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 (A<int>::*)();
+ using Result = int (A2<int>::*)();
}
#endif
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a release note, else LGTM.
@@ -475,13 +475,21 @@ struct S { | |||
|
|||
#if __cplusplus >= 201103L | |||
namespace dependent_conversion_function_id_lookup { | |||
template<typename T> struct A { | |||
struct A1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment with the number of the relevant github issue(s) ? thanks
Fixes: llvm#77583 bcd51aa fixed part of template instantiation dependent name issues but still missing some cases This patch want to enhance the dependent name check
Fixes: #77583
bcd51aa fixed part of template instantiation dependent name issues but still missing some cases This patch want to enhance the dependent name check