forked from OSchip/llvm-project
d8716cd7d3
C++ member function bodies (including ctor initializers) are first captured into a buffer and then parsed after the class is complete. (This allows members to be referenced even if declared later). When the boundary of the function body cannot be established, its buffer is discarded and late-parsing never happens (it would surely fail). For code completion this is the wrong tradeoff: the point of the parse is to generate completions as a side-effect. Today, when the ctor body wasn't typed yet there are no init list completions. With this patch we parse such an init-list if it contains the completion point. There's one caveat: the parser has to decide where to resume parsing members after a broken init list. Often the first clear recovery point is *after* the next member, so that member is missing from completion/signature help etc. e.g. struct S { S() m //<- completion here int maaa; int mbbb; } Here "int maaa;" is treated as part of the init list, so "maaa" is not available as a completion. Maybe in future indentation can be used to recognize that this is a separate member, not part of the init list. Differential Revision: https://reviews.llvm.org/D116294 |
||
---|---|---|
.. | ||
Inputs | ||
PR9728.cpp | ||
accessibility-crash.cpp | ||
accessibility.cpp | ||
after-function-equals.cpp | ||
attr.cpp | ||
auto.cpp | ||
auto_type.c | ||
bracket-decl.c | ||
call.c | ||
call.cpp | ||
comments.cpp | ||
concepts.cpp | ||
constexpr.cpp | ||
crash-func-decl.cpp | ||
crash-func-init.cpp | ||
crash-if-directive.cpp | ||
crash-null-type.cpp | ||
crash-skipped-bodies-template-inst.cpp | ||
ctor-initializer.cpp | ||
ctor-signature.cpp | ||
desig-init.cpp | ||
documentation.cpp | ||
documentation.m | ||
enable-if-attr-crash.cpp | ||
end-of-file.cpp | ||
end-of-ident-macro.cpp | ||
end-of-ident.cpp | ||
enum-preferred-type.cpp | ||
enum-switch-case-qualified.cpp | ||
enum-switch-case.c | ||
enum-switch-case.cpp | ||
function-overloads.cpp | ||
function-templates.cpp | ||
functions.cpp | ||
ignore-ns-level-decls.cpp | ||
included-files.cpp | ||
included-frameworks.m | ||
included-symlinks.cpp | ||
incomplete-member.cpp | ||
incomplete-ret-type.cpp | ||
inside-macros.cpp | ||
invalid-initialized-class.cpp | ||
keywords.cpp | ||
lambdas.cpp | ||
macros-in-modules.c | ||
macros-in-modules.m | ||
macros.c | ||
member-access-qualifiers.cpp | ||
member-access.c | ||
member-access.cpp | ||
namespace-alias.cpp | ||
namespace.cpp | ||
nested-name-specifier.cpp | ||
objc-expr.m | ||
objc-member-access.m | ||
objc-message.m | ||
objc-message.mm | ||
objc-protocol-member-access.m | ||
operator.cpp | ||
ordinary-name-cxx11.cpp | ||
ordinary-name.c | ||
ordinary-name.cpp | ||
overrides.cpp | ||
paren_locs.cpp | ||
patterns.cpp | ||
pch-and-module.m | ||
pragma-macro-token-caching.c | ||
preamble.c | ||
preferred-type.cpp | ||
qualifiers-as-written.cpp | ||
self-inits.cpp | ||
signatures-crash.cpp | ||
skip-auto-funcs.cpp | ||
some_struct.h | ||
stdin.c | ||
tag.c | ||
tag.cpp | ||
template-signature.cpp | ||
templates.cpp | ||
this-quals.cpp | ||
truncation.c | ||
truncation.c.h | ||
uninstantiated_params.cpp | ||
using-namespace.cpp | ||
using.cpp | ||
variadic-template.cpp |