translate-c: Don't make const parameters mutable. (#4273)

* translate-c: Remove arg-prefix from const parameters.
* translate-c: Add unittest for const parameters.
This commit is contained in:
Feix Weiglhofer
2020-01-24 21:32:32 +01:00
committed by Andrew Kelley
parent aa75df36df
commit a4a9330648
5 changed files with 37 additions and 8 deletions

View File

@@ -1625,6 +1625,10 @@ unsigned ZigClangFunctionDecl_getAlignedAttribute(const struct ZigClangFunctionD
return 0;
}
ZigClangQualType ZigClangParmVarDecl_getOriginalType(const struct ZigClangParmVarDecl *self) {
return bitcast(reinterpret_cast<const clang::ParmVarDecl *>(self)->getOriginalType());
}
const ZigClangRecordDecl *ZigClangRecordDecl_getDefinition(const ZigClangRecordDecl *zig_record_decl) {
const clang::RecordDecl *record_decl = reinterpret_cast<const clang::RecordDecl *>(zig_record_decl);
const clang::RecordDecl *definition = record_decl->getDefinition();