Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 5a67325

Browse files
committed
Fix bug on reporting availability of deleted methods in libclang.
Patch by Sergey Kalinichev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248596 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 696b42a commit 5a67325

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

test/Index/availability.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void foo() = delete;
2+
3+
struct Foo {
4+
int foo() = delete;
5+
Foo() = delete;
6+
};
7+
8+
9+
// RUN: c-index-test -test-print-type --std=c++11 %s | FileCheck %s
10+
// CHECK: FunctionDecl=foo:1:6 (unavailable) [type=void ()] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]
11+
// CHECK: StructDecl=Foo:3:8 (Definition) [type=Foo] [typekind=Record] [isPOD=1]
12+
// CHECK: CXXMethod=foo:4:7 (unavailable) [type=int ()] [typekind=FunctionProto] [resulttype=int] [resulttypekind=Int] [isPOD=0]
13+
// CHECK: CXXConstructor=Foo:5:3 (unavailable) [type=void ()] [typekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [isPOD=0]

tools/libclang/CIndex.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6412,7 +6412,7 @@ extern "C" {
64126412

64136413
static CXAvailabilityKind getCursorAvailabilityForDecl(const Decl *D) {
64146414
if (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isDeleted())
6415-
return CXAvailability_Available;
6415+
return CXAvailability_NotAvailable;
64166416

64176417
switch (D->getAvailability()) {
64186418
case AR_Available:

0 commit comments

Comments
 (0)