summaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 8a81cbe2623d..fbc2e7eb3067 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -641,9 +641,8 @@ static EnumDecl *findEnumForBlockReturn(Expr *E) {
}
// - it is an expression of that formal enum type.
- if (const EnumType *ET = E->getType()->getAs<EnumType>()) {
- return ET->getOriginalDecl()->getDefinitionOrSelf();
- }
+ if (auto *ED = E->getType()->getAsEnumDecl())
+ return ED;
// Otherwise, nope.
return nullptr;