File tree Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Expand file tree Collapse file tree 4 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -824,7 +824,8 @@ void Sema::ProcessAPINotes(Decl *D) {
824
824
{
825
825
auto CurrentNamespace = NamespaceContext;
826
826
while (CurrentNamespace) {
827
- NamespaceStack.push (CurrentNamespace);
827
+ if (!CurrentNamespace->isInlineNamespace ())
828
+ NamespaceStack.push (CurrentNamespace);
828
829
CurrentNamespace =
829
830
dyn_cast<NamespaceDecl>(CurrentNamespace->getParent ());
830
831
}
Original file line number Diff line number Diff line change 1
1
---
2
2
Name: Namespaces
3
+ Globals:
4
+ - Name: varInInlineNamespace
5
+ SwiftName: swiftVarInInlineNamespace
3
6
Functions:
4
7
- Name: funcInNamespace
5
8
SwiftName: inWrongContext()
9
+ - Name: funcInInlineNamespace
10
+ SwiftName: swiftFuncInInlineNamespace()
6
11
Tags:
7
12
- Name: char_box
8
13
SwiftName: InWrongContext
@@ -42,3 +47,7 @@ Namespaces:
42
47
Globals:
43
48
- Name: varInNestedNamespace
44
49
SwiftName: swiftAnotherVarInNestedNamespace
50
+ - Name: InlineNamespace1
51
+ Functions:
52
+ - Name: funcInInlineNamespace
53
+ SwiftName: shouldNotSpellOutInlineNamespaces()
Original file line number Diff line number Diff line change @@ -32,3 +32,8 @@ namespace Namespace1 {
32
32
typedef int my_typedef;
33
33
using my_using_decl = int ;
34
34
}
35
+
36
+ inline namespace InlineNamespace1 {
37
+ static int varInInlineNamespace = 3 ;
38
+ void funcInInlineNamespace ();
39
+ }
Original file line number Diff line number Diff line change 10
10
// RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::char_box -x objective-c++ | FileCheck -check-prefix=CHECK-STRUCT-IN-NESTED-NAMESPACE %s
11
11
// RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::funcInNestedNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-FUNC-IN-NESTED-NAMESPACE %s
12
12
// RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter Namespace1::Nested1::Namespace1::char_box -x objective-c++ | FileCheck -check-prefix=CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE %s
13
+ // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter varInInlineNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-GLOBAL-IN-INLINE-NAMESPACE %s
14
+ // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/CxxInterop -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter funcInInlineNamespace -x objective-c++ | FileCheck -check-prefix=CHECK-FUNC-IN-INLINE-NAMESPACE %s
13
15
14
16
#import < Namespaces.h>
15
17
56
58
// CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE: Dumping Namespace1::Nested1::Namespace1::char_box:
57
59
// CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE-NEXT: CXXRecordDecl {{.+}} imported in Namespaces <undeserialized declarations> struct char_box
58
60
// CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE: SwiftNameAttr {{.+}} <<invalid sloc>> "DeepNestedCharBox"
61
+
62
+ // CHECK-GLOBAL-IN-INLINE-NAMESPACE: Dumping varInInlineNamespace:
63
+ // CHECK-GLOBAL-IN-INLINE-NAMESPACE-NEXT: VarDecl {{.+}} imported in Namespaces varInInlineNamespace 'int' static cinit
64
+ // CHECK-GLOBAL-IN-INLINE-NAMESPACE-NEXT: IntegerLiteral {{.+}} 'int' 3
65
+ // CHECK-GLOBAL-IN-INLINE-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftVarInInlineNamespace"
66
+
67
+ // CHECK-FUNC-IN-INLINE-NAMESPACE: Dumping funcInInlineNamespace:
68
+ // CHECK-FUNC-IN-INLINE-NAMESPACE-NEXT: FunctionDecl {{.+}} imported in Namespaces funcInInlineNamespace 'void ()'
69
+ // CHECK-FUNC-IN-INLINE-NAMESPACE-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "swiftFuncInInlineNamespace()"
You can’t perform that action at this time.
0 commit comments