================
@@ -101,30 +102,63 @@ std::string removePureVirtualSyntax(const std::string
&MethodDecl,
assert(!MethodDecl.empty());
TokenStream TS = lex(MethodDecl, LangOpts);
+ auto Tokens = TS.tokens();
- std::string DeclString;
- for (const clangd::Token &Tk : TS.tokens()) {
- if (Tk.Kind == clang::tok::raw_identifier && Tk.text() == "virtual")
+ // Find the pure-specifier (= 0) by searching backwards.
+ size_t PureEqualIndex = Tokens.size();
+ for (int J = static_cast<int>(Tokens.size()) - 1; J >= 1; --J) {
----------------
timon-ul wrote:
Why are we using an `int` instead of a `size_t` for `J` ? Then there also is no
need for the `static_cast`.
https://github.com/llvm/llvm-project/pull/184023
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits