llvm-mingw
llvm-mingw copied to clipboard
attribute 'nodiscard' cannot be applied to types
Hi I'm using llvm-mingw to build wxWidgets on MacOS with x86_64-w64-mingw32 But this error was reported during compilation. Is it because mingw64 does not support the new features of C++17? Or do I need to make any special adjustments? Thank you very much.
This is my log: In file included from ../src/msw/ole/droptgt.cpp:38: ../include/wx/msw/ole/oleutils.h:107:5: error: 'nodiscard' attribute cannot be applied to types 107 | wxNODISCARD BSTR Get() const { return Copy(); } | ^ ../include/wx/defs.h:280:27: note: expanded from macro 'wxNODISCARD' 280 | #define wxNODISCARD [[nodiscard]]
I'm unable to reproduce this issue - can you specify which exact version of llvm-mingw you're using? And to make it more reproducible without me needing to try to set up compilation of the whole wxWidgets, can you provide the preprocessed output of the failing command?
I.e. when the failing command looks something like x86_64-w64-mingw32-clang++ -c wxwidgets.cpp -o wxwidgets.o -DSOMETHING -fsome-flag, remove the -c and -o wxwidgets.o parameters and add -E -o wxwidgets-preproc.cpp instead. Take the output file wxwidgets-preproc.cpp and upload it here (you might need to zip it to make github accept it) and provide the full exact failing command. (Preprocessing specific flags like -I can be omitted.) Before uploading it, you should be able to reproduce it yourself by running the failing command on the *-preproc.cpp file as well.