https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77935

            Bug ID: 77935
           Summary: uninstantiated template constructor
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefaan.deroeck at gmail dot com
  Target Milestone: ---

The following code results in:
/tmp/ccOkdgv6.o: In function `main':
u.cpp:(.text+0x26): undefined reference to `A<void ()>::A()'
collect2: error: ld returned 1 exit status

-- code --
template <class U>
struct A
{
  A() {}
};

struct B
{
  A<void()> a;
};

void func(B b = {}) {}

int main()
{
  func();
}

-- end code --

observed on:

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609
g++ (GCC) 6.1.0

Reply via email to