[cfe-dev] [clangd-dev] RFC: add RecoveryExpr to represent invalid constructs in AST
Dmitry Kozhevnikov via cfe-dev
cfe-dev at lists.llvm.org
Thu May 9 09:10:48 PDT 2019
This would be great for tooling, thank you!
- what's the type of the expression when we can't guess? (IntTy in the
> patch)
>
I think some kind of synthetic “unknown type”, not convertible to anything,
would be helpful here - so it’s guaranteed `foo(bar())` won’t pick an
unwanted overload if `bar()` is a RecoveryExpr, and `foo()` has several
overloads. It might also be somewhat useful in other places - i.e. as a
placeholder for not yet deduced init-lists (it uses VoidTy now IIRC).
It would also be great if the overload set could be captured in the
RecoveryExpr (or does it already? I haven’t look too carefully, sorry) - so
the tools can offset navigation with several targets on a failed overloaded
function call without resorting to dealing with compiler diagnostic
messages - and it might be possible to do features like “parameter info” on
the AST, without reparsing? Ex: `foo(/* hint possible parameters here from
all available overloads*/);` - now it requires reparsing in code-completion
mode, if I’m not mistaken.
—
Dmitry.
> --
Best regards,
Dmitry Kozhevnikov
CLion Team Lead
JetBrains
http://www.jetbrains.com
The Drive To Develop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190509/46a73a0c/attachment.html>
More information about the cfe-dev
mailing list