Skip to content
Open
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
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaCXXScopeSpec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static CXXRecordDecl *getCurrentInstantiationOf(QualType T,
return nullptr;
auto *RD = cast<CXXRecordDecl>(TagTy->getDecl())->getDefinitionOrSelf();
if (isa<InjectedClassNameType>(TagTy) ||
RD->isCurrentInstantiation(CurContext))
(RD->isDependentContext() && RD->isCurrentInstantiation(CurContext)))
return RD;
return nullptr;
}
Expand Down
15 changes: 15 additions & 0 deletions clang/test/SemaTemplate/dependent-names.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just add -fms-extensions to the current test invocation, since it only enables extensions but doesn't change how existing code behaves.

// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -fms-extensions %s

typedef double A;
template<typename T> class B {
Expand Down Expand Up @@ -481,3 +482,17 @@ namespace TransformNestedName {
template <typename T::template X<N<T>::State::kA>>
inline void N<T>::F() {}
} // namespace TransformNestedName

namespace GH133610 {
struct a {
using e = int;
};

#ifdef _MSC_EXTENSIONS
void current(const char * = __builtin_FUNCSIG());
template <class> void c() {
decltype(a(current()))::e;
}
#endif
}