llcppsigfetch: test typedef anonymous enum with multiple type names
This commit is contained in:
@@ -737,6 +737,132 @@ TestTypeDefDecl Case 10:
|
||||
}
|
||||
|
||||
TestTypeDefDecl Case 11:
|
||||
{
|
||||
"temp.h": {
|
||||
"_Type": "File",
|
||||
"decls": [{
|
||||
"_Type": "EnumTypeDecl",
|
||||
"Loc": {
|
||||
"_Type": "Location",
|
||||
"File": "temp.h"
|
||||
},
|
||||
"Doc": null,
|
||||
"Parent": null,
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "MyEnum"
|
||||
},
|
||||
"Type": {
|
||||
"_Type": "EnumType",
|
||||
"Items": [{
|
||||
"_Type": "EnumItem",
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "RED"
|
||||
},
|
||||
"Value": {
|
||||
"_Type": "BasicLit",
|
||||
"Kind": 0,
|
||||
"Value": "0"
|
||||
}
|
||||
}, {
|
||||
"_Type": "EnumItem",
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "GREEN"
|
||||
},
|
||||
"Value": {
|
||||
"_Type": "BasicLit",
|
||||
"Kind": 0,
|
||||
"Value": "1"
|
||||
}
|
||||
}, {
|
||||
"_Type": "EnumItem",
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "BLUE"
|
||||
},
|
||||
"Value": {
|
||||
"_Type": "BasicLit",
|
||||
"Kind": 0,
|
||||
"Value": "2"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
"_Type": "TypedefDecl",
|
||||
"Loc": {
|
||||
"_Type": "Location",
|
||||
"File": "temp.h"
|
||||
},
|
||||
"Doc": null,
|
||||
"Parent": null,
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "MyEnum2"
|
||||
},
|
||||
"Type": {
|
||||
"_Type": "TagExpr",
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "MyEnum"
|
||||
},
|
||||
"Tag": 2
|
||||
}
|
||||
}, {
|
||||
"_Type": "TypedefDecl",
|
||||
"Loc": {
|
||||
"_Type": "Location",
|
||||
"File": "temp.h"
|
||||
},
|
||||
"Doc": null,
|
||||
"Parent": null,
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "EnumPtr"
|
||||
},
|
||||
"Type": {
|
||||
"_Type": "PointerType",
|
||||
"X": {
|
||||
"_Type": "TagExpr",
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "MyEnum"
|
||||
},
|
||||
"Tag": 2
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"_Type": "TypedefDecl",
|
||||
"Loc": {
|
||||
"_Type": "Location",
|
||||
"File": "temp.h"
|
||||
},
|
||||
"Doc": null,
|
||||
"Parent": null,
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "EnumArr"
|
||||
},
|
||||
"Type": {
|
||||
"_Type": "ArrayType",
|
||||
"Elt": {
|
||||
"_Type": "TagExpr",
|
||||
"Name": {
|
||||
"_Type": "Ident",
|
||||
"Name": "MyEnum"
|
||||
},
|
||||
"Tag": 2
|
||||
},
|
||||
"Len": null
|
||||
}
|
||||
}],
|
||||
"includes": [],
|
||||
"macros": []
|
||||
}
|
||||
}
|
||||
|
||||
TestTypeDefDecl Case 12:
|
||||
{
|
||||
"temp.h": {
|
||||
"_Type": "File",
|
||||
|
||||
@@ -41,6 +41,12 @@ func TestTypeDefDecl() {
|
||||
int x;
|
||||
} MyStruct,MyStruct2,*StructPtr, StructArr[];`,
|
||||
|
||||
`typedef enum {
|
||||
RED,
|
||||
GREEN,
|
||||
BLUE
|
||||
} MyEnum,MyEnum2,*EnumPtr,EnumArr[];`,
|
||||
|
||||
`namespace A{
|
||||
namespace B{
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user