[Bug c++/103186] redefinition of template symbol error with strange error diagnostic

2021-11-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 --- Comment #6 from Andrew Pinski --- Reduced testcase for the first issue (note it is a different error but the problem is the same): using Callback = void(); template struct GetSetHelper { static void set( Callback callback_ = []() {} ){

[Bug c++/103186] redefinition of template symbol error with strange error diagnostic

2021-11-11 Thread dl.soluz at gmx dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 --- Comment #5 from dennis luehring --- -DTEST=1 compiles under Ubuntu 21.04 with g++ 10.3.0 Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hs

[Bug c++/103186] redefinition of template symbol error with strange error diagnostic

2021-11-11 Thread dl.soluz at gmx dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 --- Comment #4 from dennis luehring --- (In reply to Andrew Pinski from comment #3) > >gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=2 > > > This is wrong, you should use g++ to link as you need to link against > libstdc++ which gcc does not do

[Bug c++/103186] redefinition of template symbol error with strange error diagnostic

2021-11-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 --- Comment #3 from Andrew Pinski --- >gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=2 This is wrong, you should use g++ to link as you need to link against libstdc++ which gcc does not do which is why you are not seeing it on gcc.godbolt.

[Bug c++/103186] redefinition of template symbol error with strange error diagnostic

2021-11-11 Thread dl.soluz at gmx dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 --- Comment #2 from dennis luehring --- Created attachment 51766 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51766&action=edit s-file output of "gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=1 -save-temps"

[Bug c++/103186] redefinition of template symbol error with strange error diagnostic

2021-11-11 Thread dl.soluz at gmx dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103186 --- Comment #1 from dennis luehring --- Created attachment 51765 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51765&action=edit ii-file output of "gcc -Wall -Wextra -std=c++17 test.cpp -DTEST=1 -save-temps"