2019-05-14 05:39:55 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++2a -ast-dump=json %s | FileCheck %s
|
|
|
|
|
|
|
|
namespace foo {
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace bar {
|
|
|
|
inline namespace __1 {
|
|
|
|
}
|
|
|
|
}
|
2019-06-21 22:37:39 +08:00
|
|
|
|
|
|
|
namespace baz::quux {
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace quux::inline frobble {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
|
|
|
|
// using --filters=NamespaceDecl
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 98,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "file": "{{.*}}",
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 3,
|
|
|
|
// CHECK-NEXT: "col": 11,
|
|
|
|
// CHECK-NEXT: "tokLen": 3
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 88,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 9
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 104,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 4,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "foo"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 117,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 6,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 11,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 107,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 9
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 119,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 7,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "name": ""
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|
2019-06-21 22:37:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 132,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 9,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 11,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 3
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 122,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 9
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 163,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 12,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "bar",
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 155,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 10,
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: "col": 18,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 3
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 138,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 6
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 161,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 11,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "__1",
|
|
|
|
// CHECK-NEXT: "isInline": true
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
2019-06-21 22:37:39 +08:00
|
|
|
|
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 176,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 14,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 11,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 3
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 166,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 9
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 188,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 15,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "baz",
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 181,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 14,
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: "col": 16,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 179,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 14,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 2
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 188,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 15,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "quux"
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
|
2019-06-21 22:37:39 +08:00
|
|
|
|
|
|
|
// CHECK: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 201,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 17,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 11,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 4
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 191,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 9
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 224,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 18,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "quux",
|
|
|
|
// CHECK-NEXT: "inner": [
|
|
|
|
// CHECK-NEXT: {
|
|
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
|
|
// CHECK-NEXT: "kind": "NamespaceDecl",
|
|
|
|
// CHECK-NEXT: "loc": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 214,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 17,
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: "col": 24,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 7
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "range": {
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: "begin": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 207,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 17,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 6
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "end": {
|
2019-10-16 01:30:19 +08:00
|
|
|
// CHECK-NEXT: "offset": 224,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "line": 18,
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: "col": 1,
|
2019-06-25 04:07:11 +08:00
|
|
|
// CHECK-NEXT: "tokLen": 1
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|
2019-06-21 22:37:39 +08:00
|
|
|
// CHECK-NEXT: },
|
|
|
|
// CHECK-NEXT: "name": "frobble",
|
|
|
|
// CHECK-NEXT: "isInline": true
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
2019-05-14 05:39:55 +08:00
|
|
|
// CHECK-NEXT: }
|