File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,6 @@ class ErrorReporter {
122
122
<< Message.Message << Name;
123
123
for (const auto &FileAndReplacements : Error.Fix ) {
124
124
for (const auto &Repl : FileAndReplacements.second ) {
125
- // Retrieve the source range for applicable fixes. Macro definitions
126
- // on the command line have locations in a virtual buffer and don't
127
- // have valid file paths and are therefore not applicable.
128
- SourceRange Range;
129
125
SourceLocation FixLoc;
130
126
++TotalFixes;
131
127
bool CanBeApplied = false ;
@@ -166,7 +162,11 @@ class ErrorReporter {
166
162
FixLoc = getLocation (FixAbsoluteFilePath, Repl.getOffset ());
167
163
SourceLocation FixEndLoc =
168
164
FixLoc.getLocWithOffset (Repl.getLength ());
169
- Range = SourceRange (FixLoc, FixEndLoc);
165
+ // Retrieve the source range for applicable fixes. Macro definitions
166
+ // on the command line have locations in a virtual buffer and don't
167
+ // have valid file paths and are therefore not applicable.
168
+ CharSourceRange Range =
169
+ CharSourceRange::getCharRange (SourceRange (FixLoc, FixEndLoc));
170
170
Diag << FixItHint::CreateReplacement (Range,
171
171
Repl.getReplacementText ());
172
172
}
You can’t perform that action at this time.
0 commit comments