See Summary. The code should compile.
This is because the void main() gets type-painted to int main(); Fix pending.
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/db8c74b6cfccb4ac14d32b3f9d16aaff1e806a0c Fix Issue 17382 - void main(){}pragma(msg,main()); crashes DMD https://github.com/dlang/dmd/commit/aebbe30de5bbe34b4d2841f07dbe91548da3d0d9 Merge pull request #7316 from RazvanN7/Issue_17382 Fix Issue 17382 - void main(){}pragma(msg,main()); crashes DMD
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/db8c74b6cfccb4ac14d32b3f9d16aaff1e806a0c Fix Issue 17382 - void main(){}pragma(msg,main()); crashes DMD https://github.com/dlang/dmd/commit/aebbe30de5bbe34b4d2841f07dbe91548da3d0d9 Merge pull request #7316 from RazvanN7/Issue_17382