Index: include/clang-c/Index.h =================================================================== --- include/clang-c/Index.h +++ include/clang-c/Index.h @@ -3924,6 +3924,12 @@ */ CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C); +/** + * Determine whether the given cursor represents an inline namespace + * declaration. + */ +CINDEX_LINKAGE unsigned clang_Cursor_isInlineNamespace(CXCursor C); + enum CXRefQualifierKind { /** No ref-qualifier was provided. */ CXRefQualifier_None = 0, Index: test/Index/print-type.cpp =================================================================== --- test/Index/print-type.cpp +++ test/Index/print-type.cpp @@ -90,6 +90,8 @@ namespace { int a; } + +inline namespace InlineNS {} // RUN: c-index-test -test-print-type %s -std=c++14 | FileCheck %s // CHECK: Namespace=outer:1:11 (Definition) [type=] [typekind=Invalid] [isPOD=0] // CHECK: ClassTemplate=Foo:4:8 (Definition) [type=] [typekind=Invalid] [isPOD=0] @@ -204,3 +206,4 @@ // CHECK: UnionDecl=:86:3 (Definition) [type=X::(anonymous union at {{.*}}print-type.cpp:86:3)] [typekind=Record] [isPOD=1] [nbFields=2] [isAnon=1] // CHECK: EnumDecl=:87:3 (Definition) [type=X::(anonymous enum at {{.*}}print-type.cpp:87:3)] [typekind=Enum] [isPOD=1] [isAnon=1] // CHECK: Namespace=:90:11 (Definition) [type=] [typekind=Invalid] [isPOD=0] [isAnon=1] +// CHECK: Namespace=InlineNS:94:18 (Definition) [type=] [typekind=Invalid] [isPOD=0] [isInlineNamespace=1] Index: tools/libclang/CXType.cpp =================================================================== --- tools/libclang/CXType.cpp +++ tools/libclang/CXType.cpp @@ -1245,6 +1245,15 @@ return 0; } + +unsigned clang_Cursor_isInlineNamespace(CXCursor C) { + if (!clang_isDeclaration(C.kind)) + return 0; + const Decl *D = cxcursor::getCursorDecl(C); + const NamespaceDecl *ND = dyn_cast_or_null(D); + return ND ? ND->isInline() : 0; +} + CXType clang_Type_getNamedType(CXType CT){ QualType T = GetQualType(CT); const Type *TP = T.getTypePtrOrNull();