llvm-project/clang/test/CodeCompletion
Haojian Wu 8222107aa9 [AST] Preserve the type in RecoveryExprs for broken function calls.
RecoveryExprs are modeled as dependent type to prevent bogus diagnostics
and crashes in clang.

This patch allows to preseve the type for broken calls when the
RecoveryEprs have a known type, e.g. a broken non-overloaded call, a
overloaded call when the all candidates have the same return type, so
that more features (code completion still work on "take2args(x).^") still
work.

However, adding the type is risky, which may result in more clang code being
affected leading to new crashes and hurt diagnostic, and it requires large
effort to minimize the affect (update all sites in clang to handle errorDepend
case), so we add a new flag (off by default) to allow us to develop/test
them incrementally.

This patch also has some trivial fixes to suppress diagnostics (to prevent regressions).

Tested:

all existing tests are passed (when both "-frecovery-ast", "-frecovery-ast-type" flags are flipped on);

Reviewed By: sammccall

Subscribers: rsmith, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79160
2020-05-11 08:46:18 +02:00
..
Inputs
PR9728.cpp
accessibility-crash.cpp [CodeComplete] Cleanup access checking in code completion 2018-12-03 13:29:17 +00:00
accessibility.cpp [CodeComplete] Fix a crash in access checks of inner classes 2018-12-05 17:38:39 +00:00
auto.cpp
auto_type.c
bracket-decl.c
call.c
call.cpp [clang][CodeComplete] Make completion work after initializer lists 2020-01-23 15:32:46 +01:00
comments.cpp
concepts.cpp [CodeComplete] Member completion for concept-constrained types. 2020-03-31 18:43:24 +02:00
constexpr.cpp
crash-func-decl.cpp [CodeComplete] Fix crash when completing params function declarations. 2018-10-10 10:51:48 +00:00
crash-func-init.cpp
crash-null-type.cpp [CodeComplete] [clangd] Fix crash on ValueDecl with a null type 2019-01-24 10:41:43 +00:00
crash-skipped-bodies-template-inst.cpp [NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default 2019-02-05 12:05:53 +00:00
ctor-initializer.cpp [clang] Improve ctor initializer completions. 2018-11-01 15:54:18 +00:00
ctor-signature.cpp [clang][CodeComplete] Propogate printing policy to FunctionDecl 2020-01-20 12:20:20 +01:00
desig-init.cpp [clang][CodeComplete] Support for designated initializers 2020-01-28 16:34:15 +01:00
documentation.cpp
documentation.m
enable-if-attr-crash.cpp
end-of-file.cpp [CodeComplete] Fix completion in the middle of ident in ctor lists. 2018-04-25 15:13:34 +00:00
end-of-ident-macro.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
end-of-ident.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
enum-preferred-type.cpp [CodeComplete] Complete enumerators when preferred type is an enum 2019-05-16 16:06:57 +00:00
enum-switch-case-qualified.cpp
enum-switch-case.c
enum-switch-case.cpp
function-overloads.cpp Pass PartialOverloading argument to the correct corresponding parameter 2018-12-11 16:53:25 +00:00
function-templates.cpp [clangd] Show lambda signature for lambda autocompletions 2019-11-22 12:48:06 +01:00
functions.cpp
ignore-ns-level-decls.cpp
included-files.cpp [CodeComplete] #include completion treats -I as non-system (require header-like extension). 2018-10-01 11:56:42 +00:00
included-frameworks.m Support framework import/include auto-completion 2019-02-27 17:40:33 +00:00
included-symlinks.cpp Another fix for 7d91633a2b 2020-02-19 17:15:11 -05:00
incomplete-member.cpp [clang][CodeComplete] Dont perform fallback completion for incomplete member ref 2020-04-06 20:08:24 +02:00
incomplete-ret-type.cpp [CodeComplete] Provide completion in decls even for incomplete types 2018-05-14 13:50:36 +00:00
inside-macros.cpp
invalid-initialized-class.cpp [AST] Dont invalide VarDecl even the default initializaiton is failed. 2020-04-14 12:58:48 +02:00
keywords.cpp [CodeComplete] Add semicolon when completing patterns for 'static_assert' and 'typedef 2019-05-29 15:32:17 +00:00
lambdas.cpp [clangd] Show lambda signature for lambda autocompletions 2019-11-22 12:48:06 +01:00
macros-in-modules.c
macros-in-modules.m
macros.c [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
member-access-qualifiers.cpp [CodeComplete] Ensure object is the same in compareOverloads() 2019-10-04 08:10:27 +00:00
member-access.c [CodeComplete] Generate completion fix-its for C code as well 2018-09-21 11:23:22 +00:00
member-access.cpp [AST] Preserve the type in RecoveryExprs for broken function calls. 2020-05-11 08:46:18 +02:00
namespace-alias.cpp
namespace.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
nested-name-specifier.cpp
objc-expr.m
objc-message.m
objc-message.mm [CodeComplete] Expose InBaseClass signal in code completion results. 2018-10-24 12:57:27 +00:00
objc-protocol-member-access.m [CodeComplete] Penalize inherited ObjC properties for auto-completion 2018-11-20 22:06:54 +00:00
operator.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
ordinary-name-cxx11.cpp [CodeComplete] Include more text into typed chunks of pattern completions 2019-06-04 09:26:08 +00:00
ordinary-name.c
ordinary-name.cpp [CodeComplete] Include more text into typed chunks of pattern completions 2019-06-04 09:26:08 +00:00
overrides.cpp [CodeComplete] Filter override completions by function name 2019-05-24 10:18:39 +00:00
paren_locs.cpp [CodeComplete] Report location of opening parens for signature help 2018-08-30 13:08:03 +00:00
patterns.cpp [CodeComplete] Suggest 'return nullptr' in functions returning pointers 2020-01-10 13:28:13 +01:00
pch-and-module.m
pragma-macro-token-caching.c Refactor the way we handle diagnosing unused expression results. 2019-01-04 16:58:14 +00:00
preamble.c
preferred-type.cpp [CodeComplete] Set preferred type to bool on conditions 2018-12-13 15:36:32 +00:00
qualifiers-as-written.cpp
self-inits.cpp [CodeComplete] Do not complete self-initializations 2018-11-07 10:02:31 +00:00
signatures-crash.cpp [CodeComplete] Fix assertion failure 2018-12-07 13:17:52 +00:00
skip-auto-funcs.cpp [NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default 2019-02-05 12:05:53 +00:00
some_struct.h
stdin.c
tag.c [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
tag.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
templates.cpp [CodeComplete] Constructor overload candidates report as vector(int) instead of vector<string>(int) 2019-11-15 15:42:18 +01:00
this-quals.cpp [CodeComplete] Properly determine qualifiers of 'this' in a lambda 2018-12-19 18:01:24 +00:00
truncation.c
truncation.c.h
uninstantiated_params.cpp
using-namespace.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
using.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00