[llvm-bugs] [Bug 38910] New: Replacements::add does not de-duplicate, as documented
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Wed Sep 12 02:41:29 PDT 2018
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=38910
            Bug ID: 38910
           Summary: Replacements::add does not de-duplicate, as documented
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: steveire at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
The documentation contains:
  /// 4. Replacement A(0, 3, "ab") and B(0, 3, "ab") are order-independent
since
  ///    applying the same replacement twice is equivalent to applying it once.
However, instead, the method duplicates the insertion.
This incorrect behavior is also tested:
    TEST_F(ApplyAtomicChangesTest, AppliesDuplicateInsertions) {
      setInput("int a;");
      Changes.push_back(replacementToAtomicChange("key1", 5, 0, "b"));
      Changes.push_back(replacementToAtomicChange("key2", 5, 0, "b"));
      EXPECT_EQ("int abb;", rewrite());
    }
When I run the modernize-use-override clang-tidy check with -export-fixes and
later apply them with clang-apply-replacements, this means that I get multiple
`override` keywords in the rewritten code.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180912/47abab51/attachment.html>
    
    
More information about the llvm-bugs
mailing list