mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 03:55:48 -04:00

The original bug report can be found [here](https://github.com/clangd/clangd/issues/85) Given the following code: ```c++ void function() { auto Lambda = [](int a, double &b) {return 1.f;}; La^ } ``` Triggering the completion at `^` would show `(lambda)` before this patch and would show signature `(int a, double &b) const`, build a snippet etc with this patch. Reviewers: sammccall Reviewed by: sammccall Differential revision: https://reviews.llvm.org/D70445
28 lines
967 B
C++
28 lines
967 B
C++
namespace std {
|
|
template<typename RandomAccessIterator>
|
|
void sort(RandomAccessIterator first, RandomAccessIterator last);
|
|
|
|
template<class X, class Y>
|
|
X* dyn_cast(Y *Val);
|
|
}
|
|
|
|
class Foo {
|
|
public:
|
|
template<typename T> T &getAs();
|
|
};
|
|
|
|
template <typename T, typename U, typename V>
|
|
V doSomething(T t, const U &u, V *v) { return V(); }
|
|
|
|
void f() {
|
|
std::sort(1, 2);
|
|
Foo().getAs<int>();
|
|
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:18:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
|
|
// CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
|
|
// CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>
|
|
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
|
|
// CHECK-CC2: getAs<<#typename T#>>()
|
|
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:22 %s -o - | FileCheck -check-prefix=CHECK-CC3 %s
|
|
// CHECK-CC3: [#V#]doSomething(<#T t#>, <#const U &u#>, <#V *v#>)
|
|
}
|