aboutsummaryrefslogtreecommitdiff
path: root/src/zig_clang.cpp
diff options
context:
space:
mode:
authorEvan Haas <evan@lagerdata.com>2021-02-05 15:37:18 -0800
committerVeikka Tuominen <git@vexu.eu>2021-02-08 10:15:00 +0200
commit221f1d898c39e9ea25f1d7fc9642bfbb3c97e894 (patch)
treee7fd7ba2007c9af7cf55c9114b677b62b0186a71 /src/zig_clang.cpp
parent1adac0a55bafbba864228ac38c4684612e84f522 (diff)
downloadzig-221f1d898c39e9ea25f1d7fc9642bfbb3c97e894.tar.gz
zig-221f1d898c39e9ea25f1d7fc9642bfbb3c97e894.zip
translate-c: Improve function pointer handling
Omit address-of operator if operand is a function. Improve handling of function-call translation when using function pointers Fixes #4124
Diffstat (limited to 'src/zig_clang.cpp')
-rw-r--r--src/zig_clang.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zig_clang.cpp b/src/zig_clang.cpp
index 9bd68859e8..8dc6a0823b 100644
--- a/src/zig_clang.cpp
+++ b/src/zig_clang.cpp
@@ -2773,6 +2773,11 @@ struct ZigClangSourceLocation ZigClangUnaryOperator_getBeginLoc(const struct Zig
return bitcast(casted->getBeginLoc());
}
+struct ZigClangQualType ZigClangValueDecl_getType(const struct ZigClangValueDecl *self) {
+ auto casted = reinterpret_cast<const clang::ValueDecl *>(self);
+ return bitcast(casted->getType());
+}
+
const struct ZigClangExpr *ZigClangWhileStmt_getCond(const struct ZigClangWhileStmt *self) {
auto casted = reinterpret_cast<const clang::WhileStmt *>(self);
return reinterpret_cast<const struct ZigClangExpr *>(casted->getCond());