Fix crash when checking a dependently-typed reference that is
initialized from a non-value-dependent initializer.
llvm-svn: 363622
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index aeb7963..bcb9f05 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2282,7 +2282,7 @@
// declaration is encountered...
const VarDecl *DefVD = nullptr;
const Expr *Init = getAnyInitializer(DefVD);
- if (!Init || Init->isValueDependent())
+ if (!Init || Init->isValueDependent() || getType()->isDependentType())
return false;
// ... if it is a constexpr variable, or it is of reference type or of
// const-qualified integral or enumeration type, ...