summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeCompletion/call.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid printing some redundant name qualifiers in completionIlya Biryukov2017-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adjusted PrintingPolicy inside code completion to avoid printing some redundant name qualifiers. Before this change, typedefs that were written unqualified in source code were printed with qualifiers in completion. For example, in the following code struct foo { typedef int type; type method(); }; completion item for `method` had return type of `foo::type`, even though the original code used `type` without qualifiers. After this change, the completion item has return type `type`, as originally written in the source code. Note that this change does not suppress qualifiers written by the user. For example, in the following code typedef int type; struct foo { typedef int type; ::type method(foo::type); }; completion item for `method` has return type of `::type` and parameter type of `foo::type`, as originally written in the source code. Reviewers: arphaman, bkramer, klimek Reviewed By: arphaman Subscribers: mgorny, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D38538 llvm-svn: 317677
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-121-2/+2
| | | | | | | | | | Various tests had sprung up over the years which had --check-prefix=ABC on the RUN line, but "CHECK-ABC:" later on. This happened to work before, but was strictly incorrect. FileCheck is getting stricter soon though. Patch by Ron Ofir. llvm-svn: 188174
* Revert the fix for PR8013.Douglas Gregor2010-11-091-4/+2
| | | | | | | | | | | | | That bug concerned the well-formedness of code such as (&ovl)(a, b, c). GCC rejects the code, while EDG accepts it. On further study of the standard, I see no support for EDG's position: in particular, C++ [over.over] does not list this as a context where we can take the address of an overloaded function, C++ [over.call.func] does not reference the address-of operator at any point, and C++ [expr.call] claims that the function argument in a call is either a function lvalue or a pointer-to-function; (&ovl) is neither. llvm-svn: 118620
* Handle overload resolution when calling an overloaded function setDouglas Gregor2010-11-091-2/+4
| | | | | | with, e.g., (&f)(a, b, c). Fixes PR8013. llvm-svn: 118508
* Make -code-completion-patterns only cover multi-line codeDouglas Gregor2010-05-281-1/+1
| | | | | | | completions. Plus, tweak a few completion patterns to better reflect the language grammar. llvm-svn: 104905
* Only enable code patterns (e.g., try { statements } catch (...) {Douglas Gregor2010-05-251-1/+1
| | | | | | statements }) in the code-completion results if explicitly requested. llvm-svn: 104637
* When code completion produces an overload set as its results (e.g.,Douglas Gregor2010-04-061-0/+1
| | | | | | | while we're completing in the middle of a function call), also produce "ordinary" name results that show what can be typed at that point. llvm-svn: 100558
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-2/+2
| | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. llvm-svn: 98149
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-2/+2
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Remove RUN: true lines.Daniel Dunbar2009-11-081-1/+0
| | | | llvm-svn: 86432
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-2/+2
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* When code-completion after a "," is building an overload set, noteDouglas Gregor2009-09-231-3/+3
| | | | | | | | that there is one more argument (the one following the comma) and make the candidate non-viable if the function cannot accept any argument in that position. llvm-svn: 82625
* Print the results of code-completion for overloading by displaying theDouglas Gregor2009-09-231-5/+5
| | | | | | | signature of the function with the current parameter highlighted as a placeholder. llvm-svn: 82593
* Separate the code-completion results for call completion from theDouglas Gregor2009-09-231-7/+6
| | | | | | | | results for other, textual completion. For call completion, we now produce enough information to show the function call argument that we are currently on. llvm-svn: 82592
* Replace the -code-completion-dump option with Douglas Gregor2009-09-221-5/+12
| | | | | | | | | | | -code-completion-at=filename:line:column which performs code completion at the specified location by truncating the file at that position and enabling code completion. This approach makes it possible to run multiple tests from a single test file, and gives a more natural command-line interface. llvm-svn: 82571
* Implement code completion within a function call, triggered after theDouglas Gregor2009-09-221-0/+22
opening parentheses and after each comma. We gather the set of visible overloaded functions, perform "partial" overloading based on the set of arguments that we have thus far, and return the still-viable results sorted by the likelihood that they will be the best candidate. Most of the changes in this patch are a refactoring of the overloading routines for a function call, since we needed to separate out the notion of building an overload set (common to code-completion and normal semantic analysis) and then what to do with that overload set. As part of this change, I've pushed explicit template arguments into a few more subroutines. There is still much more work to do in this area. Function templates won't be handled well (unless we happen to deduce all of the template arguments before we hit the completion point), nor will overloaded function-call operators or calls to member functions. llvm-svn: 82549
OpenPOWER on IntegriCloud