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 | 68be76534dd276c6c849c367b2f7d2495cfdd540 (patch) | |
| tree | e69c4e945984f27dba647c9ce106988009c5e440 /clangd | |
| parent | 3f4f0d608604bdc3753223bcec2284f1d5aa36d7 (diff) | |
[clangd] Avoid enum in bitfields, can't satisfy old GCC and new MSVC
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@319608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clangd')
| -rw-r--r-- | clangd/FuzzyMatch.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clangd/FuzzyMatch.h b/clangd/FuzzyMatch.h index 283ce0ca..998c1fba 100644 --- a/clangd/FuzzyMatch.h +++ b/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(); |
