Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Functions which take Void as an argument cause the C++ compiler to error

オープン
#1,236 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
backend, compilers

調査の方向性

Haxe スニペット、Haxe 4.3.7、hxcpp 4.3.2、および haxe --cpp out Main.hx を使って報告を再現します。次に、生成された src/Main.cpp の 29 行目付近を調べ、C++ の出力を別の target と比較します。報告されたコンパイラーエラーなしでサンプルが C++ target 向けにコンパイルできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

package;

class Main {
	public static function main():Void {
		var x:(Void)->Void = _ -> {
			// bad function
		}
	}
}

Compiling this code gives an error from the C++ compiler:

$ haxe --cpp out Main.hx
haxelib run hxcpp Build.xml haxe -Dhaxe="4.3.7" -Dhaxe3="1" -Dhaxe4="1" -Dhaxe_ver="4.307" -Dhxcpp_api_level="430" -Dhxcpp_smart_strings="1" -Dsource_header="Generated by Haxe 4.3.7" -Dstatic="1" -Dtarget.atomics="1" -Dtarget.name="cpp" -Dtarget.static="1" -Dtarget.sys="1" -Dtarget.threaded="1" -Dtarget.unicode="1" -Dtarget.utf16="1" -Dutf16="1" -I -I/usr/share/haxe/std/cpp/_std/ -I/usr/share/haxe/std/
Creating /home/user/bug_report_hxcpp/out/obj/linux64/__pch/haxe/hxcpp.h.gch...

Compiling group: haxe
g++ -Iinclude -c -fvisibility=hidden -O2 -fpic -fPIC -Wno-overflow -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHX_SMART_STRINGS(haxe) -DHXCPP_API_LEVEL=430(haxe) -m64 -DHXCPP_M64 -I/home/user/haxe/hxcpp/4,3,2/include ... tags=[haxe,static]
 - src/Main.cpp 
Error: ./src/Main.cpp: In static member function ‘static void Main_obj::main()’:
./src/Main.cpp:29:43: error: invalid use of type ‘void’ in parameter declaration
   29 |                         void _hx_run(void _){
      |                                      ~~~~~^

On other targets, this compiles without emitting an error.
I am using Linux, Haxe version 4.3.7, hxcpp version 4.3.2, and g++ version 15.1.1

主要言語
C++
スター
330
フォーク
230
平均マージ
1日 6時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

HaxeFoundation/hxcpp のほかの issue

HaxeFoundation/hxcpp の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。