This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81860] New: Call to undefined inline function involving inheriting constructors
- From: "wielkiegie at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Aug 2017 12:59:48 +0000
- Subject: [Bug c++/81860] New: Call to undefined inline function involving inheriting constructors
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81860
Bug ID: 81860
Summary: Call to undefined inline function involving inheriting
constructors
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: wielkiegie at gmail dot com
Target Milestone: ---
Created attachment 41987
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41987&action=edit
Minimized test case that reproduces the issue
It seems that gcc forgets to emit or inline an empty inline constructor when
the following are used:
1. An empty template class A with empty constructor A() {} that is the one that
is missed
2. A class B with a template constructor (doesn't matter what is templated)
that accepts an object of class A with a default argument A() and stores it
inside of itself
3. A class C that derives from class B and uses inheriting constructors
Attached is a test-case for this.
$ g++ test-case3.cpp
/tmp/ccoFntWy.o: In function `main':
test-case3.cpp:(.text+0x11): undefined reference to `A<unsigned int>::A()'
collect2: error: ld returned 1 exit status
The problem does occur on gcc 7 and the newest snapshot (tested on godbolt). It
does not occur on gcc 6 and gcc 5. As such, it's a regression that first occurs
in gcc 7.