aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2020-07-13 12:05:09 +0200
committerHaojian Wu <hokein.wu@gmail.com>2020-07-13 12:05:09 +0200
commit1d3d9c7b589e6471edc0d8a2272c399d2ce6a13c (patch)
treeec2e6293381d7da8ed3b6323abc2dfecd9bf08b4 /clang/lib/Parse/ParseTentative.cpp
parentafcc9a81d2dce92f98732ecc90433141c346971a (diff)
downloadllvm-1d3d9c7b589e6471edc0d8a2272c399d2ce6a13c.zip
llvm-1d3d9c7b589e6471edc0d8a2272c399d2ce6a13c.tar.gz
llvm-1d3d9c7b589e6471edc0d8a2272c399d2ce6a13c.tar.bz2
[clang] Include type specifiers in typo correction when checking isCXXDeclarationSpecifiers.
- add more tests (the test added in https://github.com/llvm/llvm-project/commit/2f448467e4254ddc3191136c968e6054bc009b88 is weak); - improve the `MyTemplate<type_typo, int>();` case, with this patch, typo correction suggests the type decl, and no regressions found. Differential Revision: https://reviews.llvm.org/D83025
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r--clang/lib/Parse/ParseTentative.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index 948162c..f026f3a 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -1110,8 +1110,9 @@ class TentativeParseCCC final : public CorrectionCandidateCallback {
public:
TentativeParseCCC(const Token &Next) {
WantRemainingKeywords = false;
- WantTypeSpecifiers = Next.isOneOf(tok::l_paren, tok::r_paren, tok::greater,
- tok::l_brace, tok::identifier);
+ WantTypeSpecifiers =
+ Next.isOneOf(tok::l_paren, tok::r_paren, tok::greater, tok::l_brace,
+ tok::identifier, tok::comma);
}
bool ValidateCandidate(const TypoCorrection &Candidate) override {