================
@@ -219,17 +219,19 @@ void WalkAST::VisitCallExpr(CallExpr *CE) {
if (containsBadStrncatPattern(CE)) {
const Expr *DstArg = CE->getArg(0);
const Expr *LenArg = CE->getArg(2);
- PathDiagnosticLocation Loc =
- PathDiagnosticLocation::createBegin(LenArg, BR.getSourceManager(), AC);
+ PathDiagnosticLocation Loc = PathDiagnosticLocation::createBegin(
+ LenArg, BR.getSourceManager(), AC);
StringRef DstName = getPrintableName(DstArg);
SmallString<256> S;
llvm::raw_svector_ostream os(S);
os << "Potential buffer overflow. ";
if (!DstName.empty()) {
- os << "Replace with 'sizeof(" << DstName << ") "
- "- strlen(" << DstName <<") - 1'";
+ os << "Replace with 'sizeof(" << DstName
+ << ") "
+ "- strlen("
+ << DstName << ") - 1'";
----------------
pogo59 wrote:
Yeah, lots of these ostream chained operators are written to reflect coherent
bits of output, and clang-format will be unaware of the semantic relevance. I
think `clang-format off` is the only solution here.
https://github.com/llvm/llvm-project/pull/82599
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits