commit 10ff48cb9f7817ae8e95e71bd4b22989dafb2be2
Author: Jason Merrill <jason@redhat.com>
Date: Tue Oct 18 14:25:42 2011 -0400
PR c++/50531
* pt.c (instantiate_decl): Recognize when a function defaulted
outside the class is already instantiated.
@@ -18045,6 +18045,8 @@ instantiate_decl (tree d, int defer_ok,
d = DECL_CLONED_FUNCTION (d);
if (DECL_TEMPLATE_INSTANTIATED (d)
+ || (TREE_CODE (d) == FUNCTION_DECL
+ && DECL_DEFAULTED_FN (d) && DECL_INITIAL (d))
|| DECL_TEMPLATE_SPECIALIZATION (d))
/* D has already been instantiated or explicitly specialized, so
there's nothing for us to do here.
new file mode 100644
@@ -0,0 +1,21 @@
+// PR c++/50531
+// { dg-options -std=c++0x }
+
+template <typename T>
+class DataFilter
+{
+ public:
+ inline virtual ~DataFilter();
+};
+
+template<typename T>
+inline DataFilter<T>::~DataFilter() = default;
+
+class ARCalculator : public DataFilter<ARCalculator>
+{
+ public:
+ virtual void dataStart(int, int);
+};
+
+void ARCalculator::dataStart(int, int)
+{}