File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,9 @@ generateReplacement(const MatchFinder::MatchResult &Match,
124
124
if (ArgType == ResultType)
125
125
continue ;
126
126
127
- const StringRef ArgText =
128
- Lexer::getSourceText (
129
- CharSourceRange::getTokenRange (Arg->getSourceRange ()), SourceMngr,
130
- LanguageOpts);
127
+ const StringRef ArgText = Lexer::getSourceText (
128
+ CharSourceRange::getTokenRange (Arg->getSourceRange ()), SourceMngr,
129
+ LanguageOpts);
131
130
132
131
Twine Replacement = llvm::Twine (" static_cast<" )
133
132
.concat (ResultType.getAsString (LanguageOpts))
@@ -146,6 +145,10 @@ generateReplacement(const MatchFinder::MatchResult &Match,
146
145
generateReplacement (Match, InnerCall, InnerResult);
147
146
const bool IsInnerInitializerList = InnerResult.First == InnerResult.Last ;
148
147
148
+ // if the nested call doesn't have arguments skip it
149
+ if (!InnerResult.First || !InnerResult.Last )
150
+ continue ;
151
+
149
152
// if the nested call is not the same as the top call
150
153
if (InnerCall->getDirectCallee ()->getQualifiedNameAsString () !=
151
154
TopCall->getDirectCallee ()->getQualifiedNameAsString ())
You can’t perform that action at this time.
0 commit comments