https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108383
Julian Waters <tanksherman27 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tanksherman27 at gmail dot com
--- Comment #12 from Julian Waters <tanksherman27 at gmail dot com> ---
I'm not sure if this has been fixed sometime in gcc 15 or if the reduced
testcase is not sufficient in reproducing the bug. Someone I'm in contact with
recently attempted to reproduce the bug with the attached testcase while in
preparation for working on fixing it but could not reproduce it even with
-fdeclone-ctor-dtor explicitly turned on, the linker instead showing the
expected undefined symbol error for the program lacking a main method:
# g++ simplecpp.cpp clangimport.cpp -flto -Os -fdeclone-ctor-dtor
simplecpp.cpp: In member function 'int std::vector< <template-parameter-1-1>,
<template-parameter-1-2> >::push_back(std::__cxx11::basic_string<char>&)':
simplecpp.cpp:16:58: warning: no return statement in function returning
non-void [-Wreturn-type]
16 | push_back(basic_string<char> &) { _M_realloc_append(); }
| ^
simplecpp.cpp: In member function 'int std::vector< <template-parameter-1-1>,
<template-parameter-1-2> >::_M_realloc_append()':
simplecpp.cpp:27:3: warning: no return statement in function returning non-void
[-Wreturn-type]
27 | }
| ^
simplecpp.cpp: In function 'int
TokenListfileIndex(std::__cxx11::basic_string<char>&)':
simplecpp.cpp:33:1: warning: no return statement in function returning non-void
[-Wreturn-type]
33 | }
| ^
clangimport.cpp: In member function 'int std::vector< <template-parameter-1-1>,
<template-parameter-1-2> >::push_back(std::__cxx11::basic_string<char>)':
clangimport.cpp:21:3: warning: no return statement in function returning
non-void [-Wreturn-type]
21 | }
| ^
clangimport.cpp: In function 'int addTypeTokens()':
clangimport.cpp:35:1: warning: no return statement in function returning
non-void [-Wreturn-type]
35 | }
| ^
simplecpp.cpp:17:10: warning: type 'struct _Guard_alloc' violates the C++ One
Definition Rule [-Wod]
17 | struct _Guard_alloc {
| ^
clangimport.cpp:22:10: note: a different type is defined in another translation
unit
22 | struct _Guard_alloc {
| ^
simplecpp.cpp:18:13: note: the first difference of corresponding definitions is
field '_M_storage'
18 | pointer _M_storage;
| ^
clangimport.cpp:23:13: note: a field of same name but different type is defined
in another translation unit
23 | pointer _M_storage;
| ^
.../lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o): in function `main':
.../crtexewin.c:62:(.text.startup+0xb6): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
# g++ -v
Using built-in specs.
COLLECT_GCC=C:\msys64\ucrt64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/15.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-15.1.0/configure --prefix=/ucrt64
--with-local-prefix=/ucrt64/local
--with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib
--enable-bootstrap --enable-checking=release --with-arch=nocona
--with-tune=generic --enable-mingw-wildcard --enable-languages=c,lto,c++
--enable-shared --enable-static --enable-libatomic --enable-threads=win32
--enable-graphite --enable-fully-dynamic-string
--enable-libstdcxx-backtrace=yes --enable-libstdcxx-threads
--enable-libstdcxx-filesystem-ts --enable-libstdcxx-time
--disable-libstdcxx-pch --enable-lto --disable-libgomp --enable-tls
--disable-libssp --disable-multilib --disable-rpath --disable-win32-registry
--disable-nls --disable-werror --disable-symvers --with-libiconv
--with-system-zlib --with-gmp=/ucrt64 --with-mpfr=/ucrt64 --with-mpc=/ucrt64
--with-isl=/ucrt64 --with-pkgversion='Rev6, Built by MSYS2 project'
--with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as
--with-gnu-ld --disable-libstdcxx-debug --enable-plugin
--with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: win32
Supported LTO compression algorithms: zlib zstd
gcc version 15.1.0 (Rev6, Built by MSYS2 project)