]> granicus.if.org Git - clang/commitdiff
From Justin Handville:
authorChris Lattner <sabre@nondot.org>
Sun, 16 Sep 2007 19:27:16 +0000 (19:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 16 Sep 2007 19:27:16 +0000 (19:27 +0000)
"The ExpectedStr search was starting at the end of the comment string.
This patch starts the search at the beginning of the comment string.
After applying this patch, clang -parse-ast-check on negative test
case source files worked as expected."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42012 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/DiagChecker.cpp

index 3b08924d4f54070b2edf9a9e1d4a626d6e4b6d1f..48d804978022bfdbe0b41725167a46d0e1b2948d 100644 (file)
@@ -51,7 +51,7 @@ static void FindDiagnostics(const std::string &Comment,
                             const char * const ExpectedStr) {
   // Find all expected diagnostics
   typedef std::string::size_type size_type;
-  size_type ColNo = std::string::npos;
+  size_type ColNo = 0;
 
   for (;;) {
     ColNo = Comment.find(ExpectedStr, ColNo);