summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/FuzzyMatch.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/FuzzyMatch.h')
-rw-r--r--clang-tools-extra/clangd/FuzzyMatch.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/FuzzyMatch.h b/clang-tools-extra/clangd/FuzzyMatch.h
index 283ce0ca600..998c1fba810 100644
--- a/clang-tools-extra/clangd/FuzzyMatch.h
+++ b/clang-tools-extra/clangd/FuzzyMatch.h
@@ -45,7 +45,11 @@ private:
constexpr static int MaxPat = 63, MaxWord = 127;
enum CharRole : unsigned char; // For segmentation.
enum CharType : unsigned char; // For segmentation.
- enum Action : unsigned char { Miss = 0, Match = 1 };
+ // Action should be an enum, but this causes bitfield problems:
+ // - for MSVC the enum type must be explicitly unsigned for correctness
+ // - GCC 4.8 complains not all values fit if the type is unsigned
+ using Action = bool;
+ constexpr static Action Miss = false, Match = true;
bool init(llvm::StringRef Word);
void buildGraph();
OpenPOWER on IntegriCloud