summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-04-18 04:55:51 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-04-18 04:55:51 +0000
commitbc4cc14cd77bf0e4bf9eac056ca3773d6be85471 (patch)
treecd29be3472691a84eb7a5b879ce5587aae2448dc /clang/lib/Sema/SemaDecl.cpp
parent45951a662644f5a5e021806e8a75984115b9ebef (diff)
downloadbcm5719-llvm-bc4cc14cd77bf0e4bf9eac056ca3773d6be85471.tar.gz
bcm5719-llvm-bc4cc14cd77bf0e4bf9eac056ca3773d6be85471.zip
[Sema] Don't crash if array bound calculation overflowed constexpr array
We didn't correctly expect a QualifiedTypeLoc when faced with fixing a variable array type into a constant array type. Differential Revision: http://reviews.llvm.org/D8958 llvm-svn: 235251
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 1bad38f53b8..f6cb2829cf5 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4891,6 +4891,8 @@ static QualType TryToFixInvalidVariablyModifiedType(QualType T,
static void
FixInvalidVariablyModifiedTypeLoc(TypeLoc SrcTL, TypeLoc DstTL) {
+ SrcTL = SrcTL.getUnqualifiedLoc();
+ DstTL = DstTL.getUnqualifiedLoc();
if (PointerTypeLoc SrcPTL = SrcTL.getAs<PointerTypeLoc>()) {
PointerTypeLoc DstPTL = DstTL.castAs<PointerTypeLoc>();
FixInvalidVariablyModifiedTypeLoc(SrcPTL.getPointeeLoc(),
OpenPOWER on IntegriCloud