llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.38k stars 12.15k forks source link

cant use class's member function pointer with c++ module; #95701

Open DimensionNightmare opened 5 months ago

DimensionNightmare commented 5 months ago

export class DNl10n { public: DNl10n(); ~DNl10n(); const char InitConfigData(); public: unique_ptr pErrMsgData; unordered_map<uint32_t, const ErrText> mErrMsgDllData;

unique_ptr<L10nTip> pTipMsgData;
unordered_map<uint32_t, const TipText*> mTipMsgDllData;

typedef const string& (ErrText::* ErrTextFunc)() const;
ErrTextFunc pErrMsgFunc = nullptr;

typedef const string& (TipText::* TipTextFunc)() const;
TipTextFunc pTipMsgFunc = nullptr;

LangType eType = LangType::zh_CN;

};

[build] 1. parser at end of file [build] 2. D:\Project\DimensionNightmare\Servers\Source\I10n\I10nText.ixx:43:9: LLVM IR generation of declaration 'DNl10n::DNl10n' [build] 3. D:\Project\DimensionNightmare\Servers\Source\I10n\I10nText.ixx:43:9: Generating code for declaration 'DNl10n::DNl10n'

DimensionNightmare commented 5 months ago

[build] 0. Program arguments: "C:\Program Files\llvm-18.1.5\bin\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.39.33523 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name I10nText.ixx -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -gno-column-info -gcodeview -debug-info-kind=constructor -fdebug-compilation-dir=D:\Project\DimensionNightmare\Servers\out\build\Debug_llvm -object-file-name=D:\Project\DimensionNightmare\Servers\out\build\Debug_llvm\CMakeFiles\MainSource.dir\Source\I10n\I10nText.ixx.obj -fcoverage-compilation-dir=D:\Project\DimensionNightmare\Servers\out\build\Debug_llvm -resource-dir "C:\Program Files\llvm-18.1.5\lib\clang\18" -O0 -std=c++23 -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.39.33523 -fmodule-file=Config.Server=CMakeFiles/MainSource.dir/Config.Server.pcm -fmodule-file=ThirdParty.PbGen=CMakeFiles/MainSource.dir/ThirdParty.PbGen.pcm -fskip-odr-check-in-gmf --dependent-lib=msvcrtd -gcodeview -faddrsig -o CMakeFiles/MainSource.dir/Source/I10n/I10nText.ixx.obj -x pcm CMakeFiles/MainSource.dir/I10nText.pcm

llvm-18.1.5

llvmbot commented 5 months ago

@llvm/issue-subscribers-clang-modules

Author: DimensionNightmare (DimensionNightmare)

export class DNl10n { public: DNl10n(); ~DNl10n(); const char* InitConfigData(); public: unique_ptr<L10nErr> pErrMsgData; unordered_map<uint32_t, const ErrText*> mErrMsgDllData; unique_ptr<L10nTip> pTipMsgData; unordered_map<uint32_t, const TipText*> mTipMsgDllData; typedef const string& (ErrText::* ErrTextFunc)() const; ErrTextFunc pErrMsgFunc = nullptr; typedef const string& (TipText::* TipTextFunc)() const; TipTextFunc pTipMsgFunc = nullptr; LangType eType = LangType::zh_CN; }; [build] 1. <eof> parser at end of file [build] 2. D:\Project\DimensionNightmare\Servers\Source\I10n\I10nText.ixx:43:9: LLVM IR generation of declaration 'DNl10n::DNl10n' [build] 3. D:\Project\DimensionNightmare\Servers\Source\I10n\I10nText.ixx:43:9: Generating code for declaration 'DNl10n::DNl10n'
ChuanqiXu9 commented 5 months ago

Can you provide a more clear reproducer? I don't know how to proceed with the current one.