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
2 changes: 1 addition & 1 deletion clang/include/clang/AST/DeclCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -3826,7 +3826,7 @@ class UsingEnumDecl : public BaseUsingDecl, public Mergeable<UsingEnumDecl> {

public:
EnumDecl *getEnumDecl() const {
return cast<clang::EnumType>(EnumType->getType())->getOriginalDecl();
return EnumType->getType()->castAs<clang::EnumType>()->getOriginalDecl();
}

static UsingEnumDecl *Create(ASTContext &C, DeclContext *DC,
Expand Down
12 changes: 12 additions & 0 deletions clang/test/SemaTemplate/using-decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@ namespace UsingInGenericLambda {
}
void e() { c<int>(); }
}

namespace UsingUsingEnum {
namespace foo {
enum class EnumOne {};
}
using foo::EnumOne;

template <class> void t() {
using enum EnumOne;
}
template void t<void>();
} // namespace UsingUsingEnum