Skip to content

Commit 9c48e59

Browse files
author
git apple-llvm automerger
committed
Merge commit '29367747bc81' from llvm.org/main into next
2 parents d5001e4 + 2936774 commit 9c48e59

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,6 +3581,7 @@ class CompoundLiteralExpr : public Expr {
35813581
QualType T, ExprValueKind VK, Expr *init, bool fileScope)
35823582
: Expr(CompoundLiteralExprClass, T, VK, OK_Ordinary),
35833583
LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {
3584+
assert(Init && "Init is a nullptr");
35843585
setDependence(computeDependence(this));
35853586
}
35863587

@@ -3610,19 +3611,11 @@ class CompoundLiteralExpr : public Expr {
36103611
APValue &getStaticValue() const;
36113612

36123613
SourceLocation getBeginLoc() const LLVM_READONLY {
3613-
// FIXME: Init should never be null.
3614-
if (!Init)
3615-
return SourceLocation();
36163614
if (LParenLoc.isInvalid())
36173615
return Init->getBeginLoc();
36183616
return LParenLoc;
36193617
}
3620-
SourceLocation getEndLoc() const LLVM_READONLY {
3621-
// FIXME: Init should never be null.
3622-
if (!Init)
3623-
return SourceLocation();
3624-
return Init->getEndLoc();
3625-
}
3618+
SourceLocation getEndLoc() const LLVM_READONLY { return Init->getEndLoc(); }
36263619

36273620
static bool classof(const Stmt *T) {
36283621
return T->getStmtClass() == CompoundLiteralExprClass;

0 commit comments

Comments
 (0)