if you want to synthesize a variable declaration from a QualType, you can use ASTContext::getTrivialTypeSourceInfo to create a TypeSourceInfo for the QualType, then construct a VarDecl using VarDecl::Create with the TypeSourceInfo and the appropriate declaration context.