diff options
author | Kaelyn Takata <rikka@google.com> | 2014-07-28 18:14:02 +0000 |
---|---|---|
committer | Kaelyn Takata <rikka@google.com> | 2014-07-28 18:14:02 +0000 |
commit | 419d93bc37e674548e244092a79a344307f0a81e (patch) | |
tree | b963659061e7e41030b156b725df67b2dc84e819 /include/clang/Sema/TypoCorrection.h | |
parent | 32dddbfa977cb8893ae19d96e60c1abc224a3d32 (diff) |
Add another keyword-selection flag to CorrectionCandidateCallback.
The new flag, WantFunctionLikeCasts, covers a subset of the keywords
covered by WantTypeSpecifiers that can be used in casts that look like
function calls, e.g. "return long(5);", while excluding the keywords
like "enum" and "const" that would be included when WantTypeSpecifiers
is true but cannot be used in something that looks like a function call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/TypoCorrection.h')
-rw-r--r-- | include/clang/Sema/TypoCorrection.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/clang/Sema/TypoCorrection.h b/include/clang/Sema/TypoCorrection.h index 6cab59c93e..26bf0ac232 100644 --- a/include/clang/Sema/TypoCorrection.h +++ b/include/clang/Sema/TypoCorrection.h @@ -249,9 +249,9 @@ public: CorrectionCandidateCallback() : WantTypeSpecifiers(true), WantExpressionKeywords(true), - WantCXXNamedCasts(true), WantRemainingKeywords(true), - WantObjCSuper(false), IsObjCIvarLookup(false), - IsAddressOfOperand(false) {} + WantCXXNamedCasts(true), WantFunctionLikeCasts(true), + WantRemainingKeywords(true), WantObjCSuper(false), + IsObjCIvarLookup(false), IsAddressOfOperand(false) {} virtual ~CorrectionCandidateCallback() {} @@ -277,11 +277,13 @@ public: return ValidateCandidate(candidate) ? 0 : InvalidDistance; } - // Flags for context-dependent keywords. + // Flags for context-dependent keywords. WantFunctionLikeCasts is only + // used/meaningful when WantCXXNamedCasts is false. // TODO: Expand these to apply to non-keywords or possibly remove them. bool WantTypeSpecifiers; bool WantExpressionKeywords; bool WantCXXNamedCasts; + bool WantFunctionLikeCasts; bool WantRemainingKeywords; bool WantObjCSuper; // Temporary hack for the one case where a CorrectTypoContext enum is used @@ -325,6 +327,7 @@ public: WantTypeSpecifiers = false; WantExpressionKeywords = false; WantCXXNamedCasts = false; + WantFunctionLikeCasts = false; WantRemainingKeywords = false; } |