[PATCH] D126498: [clangd] Fix hover crashing on integral or enumeral casts
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 31 16:21:33 PDT 2022
sammccall added a comment.
Neat, looks like the pre-merge windows buildbot at least is happy!
I'll land this tomorrow.
================
Comment at: clang-tools-extra/clangd/unittests/HoverTests.cpp:3221
+ TestTU TU = TestTU::withCode(T.code());
+ TU.OmitPredefinedMacros = false;
+ auto AST = TU.build();
----------------
As an alternative (just to avoid adding this option), I think adding "-target=x86_64-pc-linux-gnu" would force intptr_t to be long.
Up to you.
================
Comment at: clang-tools-extra/clangd/unittests/TestTU.h:63
+ // Omit predefined macros.
+ bool OmitPredefinedMacros = true;
+
----------------
If you do add this option, please invert the sense, i.e. `bool PredefineMacros = false;`
(The double negative of Omit = false is a bit confusing to read)
And please expand the comment slightly: `"... such as __INTPTR_TYPE__"`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126498/new/
https://reviews.llvm.org/D126498
More information about the cfe-commits
mailing list