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) {
824824 {
825825 auto CurrentNamespace = NamespaceContext;
826826 while (CurrentNamespace) {
827- NamespaceStack.push (CurrentNamespace);
827+ if (!CurrentNamespace->isInlineNamespace ())
828+ NamespaceStack.push (CurrentNamespace);
828829 CurrentNamespace =
829830 dyn_cast<NamespaceDecl>(CurrentNamespace->getParent ());
830831 }
Original file line number Diff line number Diff line change 11---
22Name: Namespaces
3+ Globals:
4+ - Name: varInInlineNamespace
5+ SwiftName: swiftVarInInlineNamespace
36Functions:
47 - Name: funcInNamespace
58 SwiftName: inWrongContext()
9+ - Name: funcInInlineNamespace
10+ SwiftName: swiftFuncInInlineNamespace()
611Tags:
712 - Name: char_box
813 SwiftName: InWrongContext
@@ -42,3 +47,7 @@ Namespaces:
4247 Globals:
4348 - Name: varInNestedNamespace
4449 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 {
3232typedef int my_typedef;
3333using my_using_decl = int ;
3434}
35+
36+ inline namespace InlineNamespace1 {
37+ static int varInInlineNamespace = 3 ;
38+ void funcInInlineNamespace ();
39+ }
Original file line number Diff line number Diff line change 1010// 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
1111// 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
1212// 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
1315
1416#import < Namespaces.h>
1517
5658// CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE: Dumping Namespace1::Nested1::Namespace1::char_box:
5759// CHECK-STRUCT-IN-DEEP-NESTED-NAMESPACE-NEXT: CXXRecordDecl {{.+}} imported in Namespaces <undeserialized declarations> struct char_box
5860// 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