aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-17 21:46:17 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-17 21:46:17 +0000
commit94bc88ebf4b98018238fdedb40f5305f9b5b39c4 (patch)
treee53a0ecfaf1de7382f788adecb325751bde45224 /clang/lib
parent689509edab4d073ec3bca7d433808ae48a6cddd8 (diff)
downloadllvm-94bc88ebf4b98018238fdedb40f5305f9b5b39c4.zip
llvm-94bc88ebf4b98018238fdedb40f5305f9b5b39c4.tar.gz
llvm-94bc88ebf4b98018238fdedb40f5305f9b5b39c4.tar.bz2
Fix crash when checking a dependently-typed reference that is
initialized from a non-value-dependent initializer. llvm-svn: 363622
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/Decl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index aeb7963f..bcb9f05 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2282,7 +2282,7 @@ bool VarDecl::isUsableInConstantExpressions(ASTContext &Context) const {
// 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, ...