Skip to content
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
3 changes: 2 additions & 1 deletion clang/lib/AST/NestedNameSpecifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ NestedNameSpecifierDependence NestedNameSpecifier::getDependence() const {
NestedNameSpecifierDependence Dep =
toNestedNameSpecifierDependendence(getAsType()->getDependence());
if (NestedNameSpecifier *Prefix = getPrefix())
Dep |= Prefix->getDependence();
Dep |=
Prefix->getDependence() & ~NestedNameSpecifierDependence::Dependent;
return Dep;
}
}
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/Sema/SemaCXXScopeSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ static CXXRecordDecl *getCurrentInstantiationOf(QualType T,
const Type *Ty = T->getCanonicalTypeInternal().getTypePtr();
if (const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) {
CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordTy->getDecl());
if (!Record->isDependentContext() ||
Record->isCurrentInstantiation(CurContext))
if (Record->isCurrentInstantiation(CurContext))
return Record;

return nullptr;
Expand Down
14 changes: 14 additions & 0 deletions clang/test/SemaTemplate/dependent-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,17 @@ namespace TransformDependentTemplates {
void f(Arg<int>);
};
} // namespace TransformDependentTemplates

namespace TransformNestedName {
enum class S { kA };

template <class T> struct N {
using State = S;
template <typename T::template X<State::kA> = 0>
void F();
};

template <class T>
template <typename T::template X<N<T>::State::kA>>
inline void N<T>::F() {}
} // namespace TransformNestedName