diff options
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index f5fc3b7cb84..5d761d382a7 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -3593,8 +3593,12 @@ TreeTransform<Derived>::TransformConstantArrayType(TypeLocBuilder &TLB, if (Result.isNull()) return QualType(); } - - ConstantArrayTypeLoc NewTL = TLB.push<ConstantArrayTypeLoc>(Result); + + // We might have either a ConstantArrayType or a VariableArrayType now: + // a ConstantArrayType is allowed to have an element type which is a + // VariableArrayType if the type is dependent. Fortunately, all array + // types have the same location layout. + ArrayTypeLoc NewTL = TLB.push<ArrayTypeLoc>(Result); NewTL.setLBracketLoc(TL.getLBracketLoc()); NewTL.setRBracketLoc(TL.getRBracketLoc()); |