commit 2c7d73cc244974ee3e483cdfcddc210fdf98e25a
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jun 23 11:06:43 2011 -0400
PR c++/49507
* decl2.c (mark_used): Don't call synthesize_method for
functions defaulted outside the class.
@@ -4297,6 +4297,9 @@ mark_used (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
&& DECL_DEFAULTED_FN (decl)
+ /* A function defaulted outside the class is synthesized either by
+ cp_finish_decl or instantiate_decl. */
+ && !DECL_DEFAULTED_OUTSIDE_CLASS_P (decl)
&& ! DECL_INITIAL (decl))
{
/* Remember the current location for a function we will end up
new file mode 100644
@@ -0,0 +1,16 @@
+// PR c++/49507
+// { dg-options -std=c++0x }
+
+template<typename T>
+struct ConcretePoolKey
+{
+ virtual ~ConcretePoolKey();
+};
+
+template<typename T>
+ConcretePoolKey<T>::~ConcretePoolKey() = default;
+
+int main()
+{
+ ConcretePoolKey<int> foo;
+}