@@ -63,6 +63,12 @@ bool Converter::VisitRecoveryExpr(clang::RecoveryExpr *expr) {
6363}
6464
6565bool Converter::Convert (clang::QualType qual_type) {
66+ // Catch va_list before desugaring
67+ if (IsVaListType (qual_type)) {
68+ StrCat (" VaList" );
69+ return false ;
70+ }
71+
6672 if (Mapper::Contains (qual_type) &&
6773 Mapper::Map (qual_type) != ignore_rule_type_) {
6874 StrCat (Mapper::Map (qual_type));
@@ -243,7 +249,7 @@ bool Converter::VisitPointerType(clang::PointerType *type) {
243249 return false ;
244250 }
245251
246- if (IsVaListType (ctx_, clang::QualType (type, 0 ))) {
252+ if (IsVaListType (clang::QualType (type, 0 ))) {
247253 StrCat (" VaList" );
248254 return false ;
249255 }
@@ -371,7 +377,7 @@ bool Converter::ConvertVarDeclSkipInit(clang::VarDecl *decl) {
371377 auto qual_type = decl->getType ();
372378 auto name = GetNamedDeclAsString (decl);
373379
374- if (IsVaListType (ctx_, qual_type) && decl->isLocalVarDecl ()) {
380+ if (IsVaListType (qual_type) && decl->isLocalVarDecl ()) {
375381 ConvertVaListVarDecl (decl);
376382 return true ;
377383 }
@@ -1641,7 +1647,7 @@ bool Converter::VisitImplicitCastExpr(clang::ImplicitCastExpr *expr) {
16411647 return Convert (sub_expr);
16421648 }
16431649 // __va_list_tag [1] decays to __va_list_tag *. Just pass through by value
1644- if (IsVaListType (ctx_, sub_expr->getType ())) {
1650+ if (IsVaListType (sub_expr->getType ())) {
16451651 Convert (sub_expr);
16461652 break ;
16471653 }
@@ -2650,6 +2656,11 @@ Converter::GetFunctionPointerDefaultAsString(clang::QualType qual_type) {
26502656}
26512657
26522658std::string Converter::GetDefaultAsString (clang::QualType qual_type) {
2659+ if (IsVaListType (qual_type)) {
2660+ computed_expr_type_ = ComputedExprType::FreshValue;
2661+ return " VaList::default()" ;
2662+ }
2663+
26532664 if (qual_type->isPointerType ()) {
26542665 if (qual_type->getPointeeType ()->isFunctionType ()) {
26552666 return GetFunctionPointerDefaultAsString (qual_type);
0 commit comments