http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57728
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-06-26
CC| |jason at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The explicit instantiation declaration suppresses the definition of A<int>::A()
in defaulted.o, but the explicit instantiation definition doesn't cause that
symbol to be emitted in impl.o, so when that constructor is not inlined there
is no definition.
As a single file:
template<typename T>
struct A
{
T x;
A() = default;
A(const A &other) = delete;
};
extern template class A<int>;
int main()
{
A<int> a;
}
This compiles with clang but not G++ because Clang doesn't create a reference
to A<int>::A() from main(), so it doesn't matter that the explicit
instantiation is not defined in the program.