Skip to content

Commit d817576

Browse files
author
git apple-llvm automerger
committed
Merge commit '38832a8443d7' from llvm.org/main into next
2 parents a1c4075 + 38832a8 commit d817576

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

clang/include/clang/AST/DeclCXX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3826,7 +3826,7 @@ class UsingEnumDecl : public BaseUsingDecl, public Mergeable<UsingEnumDecl> {
38263826

38273827
public:
38283828
EnumDecl *getEnumDecl() const {
3829-
return cast<clang::EnumType>(EnumType->getType())->getOriginalDecl();
3829+
return EnumType->getType()->castAs<clang::EnumType>()->getOriginalDecl();
38303830
}
38313831

38323832
static UsingEnumDecl *Create(ASTContext &C, DeclContext *DC,

clang/test/SemaTemplate/using-decl.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,15 @@ namespace UsingInGenericLambda {
1414
}
1515
void e() { c<int>(); }
1616
}
17+
18+
namespace UsingUsingEnum {
19+
namespace foo {
20+
enum class EnumOne {};
21+
}
22+
using foo::EnumOne;
23+
24+
template <class> void t() {
25+
using enum EnumOne;
26+
}
27+
template void t<void>();
28+
} // namespace UsingUsingEnum

0 commit comments

Comments
 (0)