Skip to content

Commit 24060db

Browse files
committed
Silence diagnostics about not all control paths returning a value; NFC
1 parent 48fb8ee commit 24060db

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,7 @@ class CXXNewExpr final
23972397
case CXXNewInitializationStyle::List:
23982398
return true;
23992399
}
2400+
llvm_unreachable("Unknown initializer");
24002401
}
24012402

24022403
/// The kind of initializer this new-expression has.

clang/lib/Analysis/FlowSensitive/SimplifyConstraints.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ substitute(const Formula &F,
4242
return arena.makeEquals(substitute(*F.operands()[0], Substitutions, arena),
4343
substitute(*F.operands()[1], Substitutions, arena));
4444
}
45+
llvm_unreachable("Unknown formula kind");
4546
}
4647

4748
// Returns the result of replacing atoms in `Atoms` with the leader of their

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,6 +2050,7 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
20502050
Initializer->getBeginLoc(),
20512051
Initializer->getEndLoc());
20522052
}
2053+
llvm_unreachable("Unknown initialization kind");
20532054
}();
20542055

20552056
// C++11 [dcl.spec.auto]p6. Deduce the type which 'auto' stands in for.

0 commit comments

Comments
 (0)