mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 07:36:06 +00:00

These are an artifact of how types are structured but serve little purpose, merely showing that the type is sugared in some way. For example, ElaboratedType's existence means struct S gets printed as 'struct S':'struct S' in the AST, which is unnecessary visual clutter. Note that skipping the second print when the types have the same string matches what we do for diagnostics, where the aka will be skipped.
36 lines
991 B
Objective-C
36 lines
991 B
Objective-C
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c -fobjc-arc -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
|
|
|
|
typedef struct {
|
|
id f;
|
|
} S;
|
|
|
|
id TestCompoundLiteral(id a) {
|
|
return ((S){ .f = a }).f;
|
|
}
|
|
|
|
// CHECK: "kind": "ExprWithCleanups",
|
|
// CHECK-NEXT: "range": {
|
|
// CHECK-NEXT: "begin": {
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
|
// CHECK-NEXT: "col": 10,
|
|
// CHECK-NEXT: "tokLen": 1
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: "end": {
|
|
// CHECK-NEXT: "offset": {{[0-9]+}},
|
|
// CHECK-NEXT: "col": 26,
|
|
// CHECK-NEXT: "tokLen": 1
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: "type": {
|
|
// CHECK-NEXT: "qualType": "id",
|
|
// CHECK-NEXT: "typeAliasDeclId": "0x{{.*}}"
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: "valueCategory": "prvalue",
|
|
// CHECK-NEXT: "cleanupsHaveSideEffects": true,
|
|
// CHECK-NEXT: "cleanups": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "id": "0x{{.*}}",
|
|
// CHECK-NEXT: "kind": "CompoundLiteralExpr"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ],
|