This repository has been archived by the owner on Mar 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Incorrect parse of type declaration with template parameters #70
Comments
Unfortunately, this is CDT's (third party native parser) issue (as Michael mentioned). I've simplified the example: void foo () {
std::string result1(0); // OK, node is cpp:CPPASTDeclarationStatement
std::deque<std::string>result2(0); // NOK, node is cpp:CPPASTBinaryExpression
} ...and run against our native parser (CDT). I got following AST
{
"driver": "1.0.0",
"language": "C++",
"languageVersion": "14",
"status": "ok",
"errors": [],
"ast": {
"IASTClass": "CPPASTTranslationUnit",
"LocOffsetStart": 0,
"LocOffsetEnd": 184,
"Prop_PreprocStatements": [],
"Comments": [
{
"IASTClass": "Comment",
"Comment": "// OK, node is cpp:CPPASTDeclarationStatement",
"IsBlockComment": false,
"LocOffsetStart": 53,
"LocOffsetEnd": 98
},
{
"IASTClass": "Comment",
"Comment": "// NOK, node is cpp:CPPASTBinaryExpression",
"IsBlockComment": false,
"LocOffsetStart": 138,
"LocOffsetEnd": 180
}
],
"Prop_Declarations": [
{
"IASTClass": "CPPASTFunctionDefinition",
"LocOffsetStart": 0,
"LocOffsetEnd": 182,
"IsDefaulted": false,
"IsDeleted": false,
"Prop_Declarator": {
"IASTClass": "CPPASTFunctionDeclarator",
"LocOffsetStart": 5,
"LocOffsetEnd": 11,
"TakesVarArgs": false,
"IsConst": false,
"IsFinal": false,
"IsMutable": false,
"IsOverride": false,
"IsPureVirtual": false,
"IsVolatile": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 5,
"LocOffsetEnd": 8,
"Name": "foo"
},
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 5,
"LocOffsetEnd": 8,
"Name": "foo"
}
},
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTSimpleDeclSpecifier",
"LocOffsetStart": 0,
"LocOffsetEnd": 4,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsComplex": false,
"IsImaginary": false,
"IsLong": false,
"IsLongLong": false,
"IsShort": false,
"IsSigned": false,
"IsUnsigned": false,
"Type": "void"
},
"Prop_Body": {
"IASTClass": "CPPASTCompoundStatement",
"LocOffsetStart": 12,
"LocOffsetEnd": 182,
"Prop_Statements": [
{
"IASTClass": "CPPASTDeclarationStatement",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declaration": {
"IASTClass": "CPPASTSimpleDeclaration",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
],
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
],
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTNamedTypeSpecifier",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsTypeName": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
],
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
},
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
}
},
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
],
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTNamedTypeSpecifier",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsTypeName": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
}
}
},
"Prop_Declaration": {
"IASTClass": "CPPASTSimpleDeclaration",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
],
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTNamedTypeSpecifier",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsTypeName": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
}
}
}
},
{
"IASTClass": "CPPASTExpressionStatement",
"LocOffsetStart": 103,
"LocOffsetEnd": 137,
"Prop_Expression": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 136,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": ">",
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
},
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
],
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand1": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": "<",
"Prop_Operand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand1": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": "<",
"Prop_Operand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
},
"Prop_Operand1": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"Name": "std::deque",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 108,
"LocOffsetEnd": 113,
"Name": "deque"
}
]
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
},
"Prop_Expression": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 136,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": ">",
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand1": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": "<",
"Prop_Operand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
},
"Prop_Operand1": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"Name": "std::deque",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 108,
"LocOffsetEnd": 113,
"Name": "deque"
}
]
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
}
],
"Prop_Statements": [
{
"IASTClass": "CPPASTDeclarationStatement",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declaration": {
"IASTClass": "CPPASTSimpleDeclaration",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
],
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTNamedTypeSpecifier",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsTypeName": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
}
}
}
},
{
"IASTClass": "CPPASTExpressionStatement",
"LocOffsetStart": 103,
"LocOffsetEnd": 137,
"Prop_Expression": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 136,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": ">",
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand1": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": "<",
"Prop_Operand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
},
"Prop_Operand1": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"Name": "std::deque",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 108,
"LocOffsetEnd": 113,
"Name": "deque"
}
]
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
}
]
},
"Prop_Declarator": {
"IASTClass": "CPPASTFunctionDeclarator",
"LocOffsetStart": 5,
"LocOffsetEnd": 11,
"TakesVarArgs": false,
"IsConst": false,
"IsFinal": false,
"IsMutable": false,
"IsOverride": false,
"IsPureVirtual": false,
"IsVolatile": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 5,
"LocOffsetEnd": 8,
"Name": "foo"
}
},
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTSimpleDeclSpecifier",
"LocOffsetStart": 0,
"LocOffsetEnd": 4,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsComplex": false,
"IsImaginary": false,
"IsLong": false,
"IsLongLong": false,
"IsShort": false,
"IsSigned": false,
"IsUnsigned": false,
"Type": "void"
},
"Prop_Body": {
"IASTClass": "CPPASTCompoundStatement",
"LocOffsetStart": 12,
"LocOffsetEnd": 182,
"Prop_Statements": [
{
"IASTClass": "CPPASTDeclarationStatement",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declaration": {
"IASTClass": "CPPASTSimpleDeclaration",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
],
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTNamedTypeSpecifier",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsTypeName": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
}
}
}
},
{
"IASTClass": "CPPASTExpressionStatement",
"LocOffsetStart": 103,
"LocOffsetEnd": 137,
"Prop_Expression": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 136,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": ">",
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand1": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": "<",
"Prop_Operand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
},
"Prop_Operand1": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"Name": "std::deque",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 108,
"LocOffsetEnd": 113,
"Name": "deque"
}
]
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
}
]
}
}
],
"Prop_Comments": [],
"Prop_BuiltinMacroDefinitions": [],
"Prop_Declarations": [
{
"IASTClass": "CPPASTFunctionDefinition",
"LocOffsetStart": 0,
"LocOffsetEnd": 182,
"IsDefaulted": false,
"IsDeleted": false,
"Prop_Declarator": {
"IASTClass": "CPPASTFunctionDeclarator",
"LocOffsetStart": 5,
"LocOffsetEnd": 11,
"TakesVarArgs": false,
"IsConst": false,
"IsFinal": false,
"IsMutable": false,
"IsOverride": false,
"IsPureVirtual": false,
"IsVolatile": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 5,
"LocOffsetEnd": 8,
"Name": "foo"
}
},
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTSimpleDeclSpecifier",
"LocOffsetStart": 0,
"LocOffsetEnd": 4,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsComplex": false,
"IsImaginary": false,
"IsLong": false,
"IsLongLong": false,
"IsShort": false,
"IsSigned": false,
"IsUnsigned": false,
"Type": "void"
},
"Prop_Body": {
"IASTClass": "CPPASTCompoundStatement",
"LocOffsetStart": 12,
"LocOffsetEnd": 182,
"Prop_Statements": [
{
"IASTClass": "CPPASTDeclarationStatement",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declaration": {
"IASTClass": "CPPASTSimpleDeclaration",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
},
"Prop_Initializer": {
"IASTClass": "CPPASTConstructorInitializer",
"LocOffsetStart": 37,
"LocOffsetEnd": 40,
"Prop_Expression": {
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 38,
"LocOffsetEnd": 39,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
],
"Prop_DeclSpecifier": {
"IASTClass": "CPPASTNamedTypeSpecifier",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"IsConst": false,
"IsInline": false,
"IsRestrict": false,
"IsVolatile": false,
"StorageClass": "unspecified",
"IsConstExpr": false,
"IsExplicit": false,
"IsFriend": false,
"IsThreadLocal": false,
"IsVirtual": false,
"IsTypeName": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 18,
"LocOffsetEnd": 29,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 18,
"LocOffsetEnd": 21,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 23,
"LocOffsetEnd": 29,
"Name": "string"
}
]
}
}
}
},
{
"IASTClass": "CPPASTExpressionStatement",
"LocOffsetStart": 103,
"LocOffsetEnd": 137,
"Prop_Expression": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 136,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": ">",
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
},
"Prop_Operand1": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": "<",
"Prop_Operand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
},
"Prop_Operand1": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 103,
"LocOffsetEnd": 113,
"Name": "std::deque",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 103,
"LocOffsetEnd": 106,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 108,
"LocOffsetEnd": 113,
"Name": "deque"
}
]
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTQualifiedName",
"LocOffsetStart": 114,
"LocOffsetEnd": 125,
"Name": "std::string",
"IsConversionOperator": false,
"IsFullyQualified": false,
"Prop_Qualifier": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
}
],
"Prop_AllSegments": [
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 114,
"LocOffsetEnd": 117,
"Name": "std"
},
{
"IASTClass": "CPPASTName",
"LocOffsetStart": 119,
"LocOffsetEnd": 125,
"Name": "string"
}
]
}
}
},
"Prop_InitOperand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
},
"Prop_Arguments": [
{
"IASTClass": "CPPASTLiteralExpression",
"LocOffsetStart": 134,
"LocOffsetEnd": 135,
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"LiteralValue": "0",
"kind": "integer_constant"
}
]
}
}
}
]
}
}
],
"Prop_Comments": [],
"Prop_BuiltinMacroDefinitions": []
},
"IASTClass": "CPPASTTranslationUnit",
"Snippet": "void foo () { s...",
"LocLineStart": 1,
"LocLineEnd": 5,
"LocOffsetStart": 0,
"LocOffsetLength": 184,
"childs": [
{
"IASTClass": "CPPASTFunctionDefinition",
"Snippet": "void foo () { s...",
"LocLineStart": 1,
"LocLineEnd": 4,
"LocOffsetStart": 0,
"LocOffsetLength": 182,
"Role": "IASTTranslationUnit.OWNED_DECLARATION - IASTDeclaration for IASTTranslationUnit",
"childs": [
{
"IASTClass": "CPPASTSimpleDeclSpecifier",
"Snippet": "void",
"LocLineStart": 1,
"LocLineEnd": 1,
"LocOffsetStart": 0,
"LocOffsetLength": 4,
"Role": "IASTFunctionDefinition.DECL_SPECIFIER - IASTDeclSpecifier for IASTFunctionDefinition"
},
{
"IASTClass": "CPPASTFunctionDeclarator",
"Snippet": "foo ()",
"LocLineStart": 1,
"LocLineEnd": 1,
"LocOffsetStart": 5,
"LocOffsetLength": 6,
"Role": "IASTFunctionDefinition.DECLARATOR - IASTFunctionDeclarator for IASTFunctionDefinition",
"childs": [
{
"IASTClass": "CPPASTName",
"Snippet": "foo",
"LocLineStart": 1,
"LocLineEnd": 1,
"LocOffsetStart": 5,
"LocOffsetLength": 3,
"Role": "IASTDeclarator.DECLARATOR_NAME - IASTName for IASTDeclarator",
"SymbolName": "foo"
}
]
},
{
"IASTClass": "CPPASTCompoundStatement",
"Snippet": "{ std::string r...",
"LocLineStart": 1,
"LocLineEnd": 4,
"LocOffsetStart": 12,
"LocOffsetLength": 170,
"Role": "IASTFunctionDefinition.FUNCTION_BODY - Function Body for IASTFunctionDefinition",
"childs": [
{
"IASTClass": "CPPASTDeclarationStatement",
"Snippet": "std::string result1(...",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 18,
"LocOffsetLength": 23,
"Role": "IASTCompoundStatement.NESTED_STATEMENT - nested IASTStatement for IASTCompoundStatement",
"childs": [
{
"IASTClass": "CPPASTSimpleDeclaration",
"Snippet": "std::string result1(...",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 18,
"LocOffsetLength": 23,
"Role": "IASTDeclarationStatement.DECLARATION - Declaration for DeclarationStatement",
"childs": [
{
"IASTClass": "CPPASTNamedTypeSpecifier",
"Snippet": "std::string",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 18,
"LocOffsetLength": 11,
"Role": "IASTSimpleDeclaration.DECL_SPECIFIER - IASTDeclSpecifier for IASTSimpleDeclaration",
"childs": [
{
"IASTClass": "CPPASTQualifiedName",
"Snippet": "std::string",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 18,
"LocOffsetLength": 11,
"Role": "IASTNamedTypeSpecifier.NAME - IASTName for IASTNamedTypeSpecifier",
"SymbolName": "std::string",
"childs": [
{
"IASTClass": "CPPASTName",
"Snippet": "std",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 18,
"LocOffsetLength": 3,
"Role": "ICPPASTQualifiedName.SEGMENT_NAME - An ICPPASTNameSpecifier segment",
"SymbolName": "std"
},
{
"IASTClass": "CPPASTName",
"Snippet": "string",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 23,
"LocOffsetLength": 6,
"Role": "ICPPASTQualifiedName.SEGMENT_NAME - An ICPPASTNameSpecifier segment",
"SymbolName": "string"
}
]
}
]
},
{
"IASTClass": "CPPASTDeclarator",
"Snippet": "result1(0)",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 30,
"LocOffsetLength": 10,
"Role": "IASTSimpleDeclaration.DECLARATOR - IASTDeclarator for IASTSimpleDeclaration",
"childs": [
{
"IASTClass": "CPPASTName",
"Snippet": "result1",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 30,
"LocOffsetLength": 7,
"Role": "IASTDeclarator.DECLARATOR_NAME - IASTName for IASTDeclarator",
"SymbolName": "result1"
},
{
"IASTClass": "CPPASTConstructorInitializer",
"Snippet": "(0)",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 37,
"LocOffsetLength": 3,
"Role": "IASTDeclarator.INITIALIZER - IASTInitializer for IASTDeclarator",
"childs": [
{
"IASTClass": "CPPASTLiteralExpression",
"Snippet": "0",
"LocLineStart": 2,
"LocLineEnd": 2,
"LocOffsetStart": 38,
"LocOffsetLength": 1,
"Role": "ICPPASTConstructorInitializer.ARGUMENT - [IASTInitializerClause]",
"LiteralKind": "int",
"LiteralValue": "0",
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE"
}
]
}
]
}
]
}
]
},
{
"IASTClass": "CPPASTExpressionStatement",
"Snippet": "std::deque<std::stri...",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 103,
"LocOffsetLength": 34,
"Role": "IASTCompoundStatement.NESTED_STATEMENT - nested IASTStatement for IASTCompoundStatement",
"childs": [
{
"IASTClass": "CPPASTBinaryExpression",
"Snippet": "std::deque<std::stri...",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 103,
"LocOffsetLength": 33,
"Role": "IASTExpressionStatement.EXPRESSION - IASTExpression for IASTExpressionStatement",
"ExpressionType": "org.eclipse.cdt.internal.core.dom.parser.ProblemType@4f6f416f",
"ExpressionValueCategory": "PRVALUE",
"Operator": "than >",
"childs": [
{
"IASTClass": "CPPASTBinaryExpression",
"Snippet": "std::deque<std::stri...",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 103,
"LocOffsetLength": 22,
"Role": "IASTBinaryExpression.OPERAND_ONE - IASTExpression for LHS",
"ExpressionType": "org.eclipse.cdt.internal.core.dom.parser.ProblemType@4f6f416f",
"ExpressionValueCategory": "PRVALUE",
"Operator": "than <",
"childs": [
{
"IASTClass": "CPPASTIdExpression",
"Snippet": "std::deque",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 103,
"LocOffsetLength": 10,
"Role": "IASTBinaryExpression.OPERAND_ONE - IASTExpression for LHS",
"ExpressionType": "org.eclipse.cdt.internal.core.dom.parser.ProblemType@4f6f416f",
"ExpressionValueCategory": "PRVALUE",
"childs": [
{
"IASTClass": "CPPASTQualifiedName",
"Snippet": "std::deque",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 103,
"LocOffsetLength": 10,
"Role": "IASTIdExpression.ID_NAME - IASTName for IASTIdExpression",
"SymbolName": "std::deque",
"childs": [
{
"IASTClass": "CPPASTName",
"Snippet": "std",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 103,
"LocOffsetLength": 3,
"Role": "ICPPASTQualifiedName.SEGMENT_NAME - An ICPPASTNameSpecifier segment",
"SymbolName": "std"
},
{
"IASTClass": "CPPASTName",
"Snippet": "deque",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 108,
"LocOffsetLength": 5,
"Role": "ICPPASTQualifiedName.SEGMENT_NAME - An ICPPASTNameSpecifier segment",
"SymbolName": "deque"
}
]
}
]
},
{
"IASTClass": "CPPASTIdExpression",
"Snippet": "std::string",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 114,
"LocOffsetLength": 11,
"Role": "IASTBinaryExpression.OPERAND_TWO - IASTExpression for RHS",
"ExpressionType": "org.eclipse.cdt.internal.core.dom.parser.ProblemType@4f6f416f",
"ExpressionValueCategory": "PRVALUE",
"childs": [
{
"IASTClass": "CPPASTQualifiedName",
"Snippet": "std::string",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 114,
"LocOffsetLength": 11,
"Role": "IASTIdExpression.ID_NAME - IASTName for IASTIdExpression",
"SymbolName": "std::string",
"childs": [
{
"IASTClass": "CPPASTName",
"Snippet": "std",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 114,
"LocOffsetLength": 3,
"Role": "ICPPASTQualifiedName.SEGMENT_NAME - An ICPPASTNameSpecifier segment",
"SymbolName": "std"
},
{
"IASTClass": "CPPASTName",
"Snippet": "string",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 119,
"LocOffsetLength": 6,
"Role": "ICPPASTQualifiedName.SEGMENT_NAME - An ICPPASTNameSpecifier segment",
"SymbolName": "string"
}
]
}
]
}
]
},
{
"IASTClass": "CPPASTFunctionCallExpression",
"Snippet": "result2(0)",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 126,
"LocOffsetLength": 10,
"Role": "IASTBinaryExpression.OPERAND_TWO - IASTExpression for RHS",
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"childs": [
{
"IASTClass": "CPPASTIdExpression",
"Snippet": "result2",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 126,
"LocOffsetLength": 7,
"Role": "IASTFunctionCallExpression.FUNCTION_NAME [IASTExpression]",
"ExpressionType": "org.eclipse.cdt.internal.core.dom.parser.ProblemType@4f6f416f",
"ExpressionValueCategory": "PRVALUE",
"childs": [
{
"IASTClass": "CPPASTName",
"Snippet": "result2",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 126,
"LocOffsetLength": 7,
"Role": "IASTIdExpression.ID_NAME - IASTName for IASTIdExpression",
"SymbolName": "result2"
}
]
},
{
"IASTClass": "CPPASTLiteralExpression",
"Snippet": "0",
"LocLineStart": 3,
"LocLineEnd": 3,
"LocOffsetStart": 134,
"LocOffsetLength": 1,
"Role": "IASTFunctionCallExpression.ARGUMENT [IASTInitializerClause]",
"LiteralKind": "int",
"LiteralValue": "0",
"ExpressionType": "int",
"ExpressionValueCategory": "PRVALUE"
}
]
}
]
}
]
}
]
}
]
}
]
} So, you can see that "Prop_Declaration": {
"IASTClass": "CPPASTSimpleDeclaration",
"LocOffsetStart": 18,
"LocOffsetEnd": 41,
"Prop_Declarators": [
{
"IASTClass": "CPPASTDeclarator",
"LocOffsetStart": 30,
"LocOffsetEnd": 40,
"DeclaresParameterPack": false,
"Prop_TypeNode": null,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 30,
"LocOffsetEnd": 37,
"Name": "result1"
}, ...but "Prop_Expression": {
"IASTClass": "CPPASTBinaryExpression",
"LocOffsetStart": 103,
"LocOffsetEnd": 136,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Operator": ">",
"Prop_Operand2": {
"IASTClass": "CPPASTFunctionCallExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 136,
"ExpressionType": "Attempt to use symbol failed: result2",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_FunctionNameExpression": {
"IASTClass": "CPPASTIdExpression",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"ExpressionType": "",
"ExpressionValueCategory": "PRVALUE",
"IsLValue": false,
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
},
"Prop_Name": {
"IASTClass": "CPPASTName",
"LocOffsetStart": 126,
"LocOffsetEnd": 133,
"Name": "result2"
}
}, I mark this issue as blocked because it depends on our third-party library. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Originally reported by Olivier Mesnard in https://forum.sourced.tech/t/parsing-cpp-code-with-parameterized-types/246.
The CDT C++ parser may be incorrectly treating the template instantiation brackets as operators.
Repro (courtesy of Olivier): Given the sample code
the following client script demonstrates the bug:
I suspect CDT (or at least the version of it we're using in the driver) may not be up-to-date with the lexical changes from C++11 et seq.
The text was updated successfully, but these errors were encountered: