зеркало из https://github.com/microsoft/clang-1.git
Member function templates can occur after . or ->
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ecb7e932e9
Коммит
ce82196076
|
@ -587,7 +587,8 @@ bool ResultBuilder::IsMember(NamedDecl *ND) const {
|
|||
if (UsingShadowDecl *Using = dyn_cast<UsingShadowDecl>(ND))
|
||||
ND = Using->getTargetDecl();
|
||||
|
||||
return isa<ValueDecl>(ND) || isa<ObjCPropertyDecl>(ND);
|
||||
return isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND) ||
|
||||
isa<ObjCPropertyDecl>(ND);
|
||||
}
|
||||
|
||||
// Find the next outer declaration context corresponding to this scope.
|
||||
|
|
|
@ -6,9 +6,18 @@ namespace std {
|
|||
X* dyn_cast(Y *Val);
|
||||
}
|
||||
|
||||
class Foo {
|
||||
public:
|
||||
template<typename T> T &getAs();
|
||||
};
|
||||
|
||||
void f() {
|
||||
std::
|
||||
// RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s
|
||||
std::sort(1, 2);
|
||||
Foo().getAs<int>();
|
||||
// RUN: clang-cc -fsyntax-only -code-completion-at=%s:15:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
// CHECK-CC1: dyn_cast<<#class X#>>(<#Y *Val#>)
|
||||
// CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>)
|
||||
// CHECK-CC1: sort(<#RandomAccessIterator first#>, <#RandomAccessIterator last#>
|
||||
// RUN: clang-cc -fsyntax-only -code-completion-at=%s:16:9 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
|
||||
// CHECK-CC2: getAs<<#typename T#>>()
|
||||
)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче