diff options
author | Sam McCall <sam.mccall@gmail.com> | 2017-12-02 04:15:55 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2017-12-02 04:15:55 +0000 |
commit | 3ea964090a53cb6e9840366098efb03d58d080cb (patch) | |
tree | 37a7d34375d70ba7dab20a2a36cffc54b4dd5113 /clang-tools-extra/clangd/FuzzyMatch.h | |
parent | 839ff79a8d29968d01002b997b94897a00242ff0 (diff) | |
download | bcm5719-llvm-3ea964090a53cb6e9840366098efb03d58d080cb.tar.gz bcm5719-llvm-3ea964090a53cb6e9840366098efb03d58d080cb.zip |
[clangd] Avoid enum in bitfields, can't satisfy old GCC and new MSVC
llvm-svn: 319608
Diffstat (limited to 'clang-tools-extra/clangd/FuzzyMatch.h')
-rw-r--r-- | clang-tools-extra/clangd/FuzzyMatch.h | 6 |
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(); |