From: Sebastian Redl Date: Sun, 26 Oct 2008 19:05:16 +0000 (+0000) Subject: Allow \n for newlines in expected error messages. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad3c91c267b071db52df308eb6d80fb336a8dee5;p=clang Allow \n for newlines in expected error messages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58198 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/DiagChecker.cpp b/Driver/DiagChecker.cpp index 6f7ea0b739..51f3979b92 100644 --- a/Driver/DiagChecker.cpp +++ b/Driver/DiagChecker.cpp @@ -78,6 +78,10 @@ static void FindDiagnostics(const std::string &Comment, } std::string Msg(Comment.substr(OpenDiag, CloseDiag - OpenDiag)); + size_type FindPos; + while((FindPos = Msg.find("\\n")) != std::string::npos) { + Msg.replace(FindPos, 2, "\n"); + } ExpectedDiags.push_back(std::make_pair(Pos, Msg)); ColNo = CloseDiag + 2; }