[clang-tools-extra] r269896 - [clang-tidy] Fix a functional change from r269656.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 04:32:26 PDT 2016


Thank you for fixing this!

On Wed, May 18, 2016 at 11:48 AM, Benjamin Kramer via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: d0k
> Date: Wed May 18 04:48:46 2016
> New Revision: 269896
>
> URL: http://llvm.org/viewvc/llvm-project?rev=269896&view=rev
> Log:
> [clang-tidy] Fix a functional change from r269656.
>
> Instead of forming char ranges that patch made us form token ranges,
> which behave subtly different. Sadly I'm only seeing this as part of a
> larger test case that I haven't fully reduced yet.
>
> Modified:
>     clang-tools-extra/trunk/clang-tidy/utils/IncludeSorter.cpp
>
> Modified: clang-tools-extra/trunk/clang-tidy/utils/IncludeSorter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/IncludeSorter.cpp?rev=269896&r1=269895&r2=269896&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/clang-tidy/utils/IncludeSorter.cpp (original)
> +++ clang-tools-extra/trunk/clang-tidy/utils/IncludeSorter.cpp Wed May 18
> 04:48:46 2016
> @@ -254,8 +254,8 @@ std::vector<FixItHint> IncludeSorter::Ge
>        // Otherwise report the current block edit and start a new block.
>      } else {
>        if (CurrentEndLine) {
> -        Fixes.push_back(
> -            FixItHint::CreateReplacement(CurrentRange, CurrentText));
> +        Fixes.push_back(FixItHint::CreateReplacement(
> +            CharSourceRange::getCharRange(CurrentRange), CurrentText));
>        }
>
>        CurrentEndLine = LineEdit.first;
> @@ -265,7 +265,8 @@ std::vector<FixItHint> IncludeSorter::Ge
>    }
>    // Finally, report the current block edit if there is one.
>    if (CurrentEndLine) {
> -    Fixes.push_back(FixItHint::CreateReplacement(CurrentRange,
> CurrentText));
> +    Fixes.push_back(FixItHint::CreateReplacement(
> +        CharSourceRange::getCharRange(CurrentRange), CurrentText));
>    }
>
>    // Reset the remaining internal state.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160518/cd348274/attachment.html>


More information about the cfe-commits mailing list