Commit 15e0646f by Jason Merrill Committed by Jason Merrill

re PR c++/50531 ([C++0x] ICE on defaulted template destructor)

	PR c++/50531
	* pt.c (instantiate_decl): Recognize when a function defaulted
	outside the class is already instantiated.

From-SVN: r180162
parent d2f70641
2011-10-18 Jason Merrill <jason@redhat.com>
PR c++/50531
* pt.c (instantiate_decl): Recognize when a function defaulted
outside the class is already instantiated.
PR c++/50742
* decl.c (check_previous_goto_1): Handle using-decl.
......
......@@ -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.
......
2011-10-18 Jason Merrill <jason@redhat.com>
PR c++/50531
* g++.dg/cpp0x/defaulted32.C: New.
PR c++/50742
* g++.dg/lookup/using23.C: New.
......
// 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)
{}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment