Here when we merged the specialization with the implicit instantiation
declaration, we wrongly kept the value of DECL_INITIALIZED_IN_CLASS_P from
the latter.
gcc/cp/ChangeLog:
PR c++/90674
* decl.c (duplicate_decls): Don't propagate
DECL_INITIALIZED_IN_CLASS_P to a specialization.
gcc/testsuite/ChangeLog:
PR c++/90674
* g++.dg/debug/defaulted1.C: New test.
if (!DECL_USE_TEMPLATE (newdecl))
DECL_USE_TEMPLATE (newdecl) = DECL_USE_TEMPLATE (olddecl);
- DECL_INITIALIZED_IN_CLASS_P (newdecl)
- |= DECL_INITIALIZED_IN_CLASS_P (olddecl);
+ if (!DECL_TEMPLATE_SPECIALIZATION (newdecl))
+ DECL_INITIALIZED_IN_CLASS_P (newdecl)
+ |= DECL_INITIALIZED_IN_CLASS_P (olddecl);
}
/* Don't really know how much of the language-specific
--- /dev/null
+// PR c++/90674
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct C {
+ C() {}
+};
+
+template<>
+C<int>::C() = default;