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_ = []() {} ){
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
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
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.
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"
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"