Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot mangle injected class name type. UNREACHABLE executed at C:\src\llvm_package_1200-rc3\llvm-project\clang\lib\AST\MicrosoftMangle.cpp:3139! #281

Open
GavinRay97 opened this issue Apr 13, 2021 · 3 comments
Labels
bug C++ C++ translation

Comments

@GavinRay97
Copy link

Attempting to run d++ on this C++ header:
https://gist.githubusercontent.com/GavinRay97/b8bdb882a391e63cb7e2f73b247d4a6e/raw/87ddc1678079b7034b91229660a9ad160af0ed5a/juce_audio_plugin_client_amalgamated.h

With the following D file:

#include "./juce_audio_plugin_client_amalgamated.h"

void main() {
  return;
}
DPP_DEFINES = 	--define _WIN32 --define _WIN64 --define MSC_VER=1 --define JUCE_MSVC=1 --define JUCE_WINDOWS=1 \
				--define JUCE_STRING=1_UTF_TYPE=16 --define JUCE_PLUGINHOST_VST3=1 \
				--define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1

DPP_FLAGS = --compiler dmd --preprocess-only --parse-as-cpp --c++-standard-17 --detailed-untranslatables \
			--ignore-macros --no-sys-headers \
			--ignore-ns "std" \
			--ignore-cursor "StringRef"

dpp:
	d++ $(DPP_FLAGS) $(DPP_DEFINES) test.dpp
$ make dpp
MAKE Version 5.41  Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
        d++ --compiler dmd --preprocess-only --parse-as-cpp --c++-standard-17 --detailed-untranslatables   --ignore-macros --no-sys-headers   --ignore-ns "std"   --ignore-cursor "StringRef" --define _WIN32 --define _WIN64 --define MSC_VER=1 --define JUCE_MSVC=1 --define JUCE_WINDOWS=1   --define JUCE_STRING=1_UTF_TYPE=16 --define JUCE_PLUGINHOST_VST3=1 --define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED=1 test.dpp

Cannot mangle injected class name type.

UNREACHABLE executed at C:\src\llvm_package_1200-rc3\llvm-project\clang\lib\AST\MicrosoftMangle.cpp:3139!

** error -1073741795 ** deleting dpp

I wasn't really expecting dpp to be able to translate this, mostly was just curious -- but I couldn't find references to this error anywhere so thought it might be useful in case someone else runs across it in the future.

Thanks =)

@atilaneves
Copy link
Owner

Oof, Windows. Might take me a while to get to this if I can't repro on Linux.

BTW, --c++-standard-17 should be --c++-standard=c++17.

@atilaneves atilaneves added bug C++ C++ translation labels Apr 22, 2021
@GavinRay97
Copy link
Author

GavinRay97 commented Apr 22, 2021

If you've not got a Windows machine handy, I'm not sure I would bother (that sounds like a lot of work 😅).

I have LLVM 13 built from source on both Windows + Ubuntu (WSL2) so maybe I can build d++ in debug and get a backtrace and post it here if that'd be useful at all

@atilaneves
Copy link
Owner

That'd be very helpful, thanks.

The problem isn't my access to a Windows machine, it's trying to not punch the wall while using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug C++ C++ translation
Projects
None yet
Development

No branches or pull requests

2 participants