re PR c++/49507 (ICE because of defaulted template destructor)
PR c++/49507 * decl2.c (mark_used): Don't call synthesize_method for functions defaulted outside the class. From-SVN: r175342
This commit is contained in:
parent
d72ce0c110
commit
767de87d05
|
@ -1,5 +1,9 @@
|
||||||
2011-06-23 Jason Merrill <jason@redhat.com>
|
2011-06-23 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/49507
|
||||||
|
* decl2.c (mark_used): Don't call synthesize_method for
|
||||||
|
functions defaulted outside the class.
|
||||||
|
|
||||||
* optimize.c (maybe_clone_body): Set linkage flags before
|
* optimize.c (maybe_clone_body): Set linkage flags before
|
||||||
cgraph_same_body_alias.
|
cgraph_same_body_alias.
|
||||||
|
|
||||||
|
|
|
@ -4297,6 +4297,9 @@ mark_used (tree decl)
|
||||||
if (TREE_CODE (decl) == FUNCTION_DECL
|
if (TREE_CODE (decl) == FUNCTION_DECL
|
||||||
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
|
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
|
||||||
&& DECL_DEFAULTED_FN (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))
|
&& ! DECL_INITIAL (decl))
|
||||||
{
|
{
|
||||||
/* Remember the current location for a function we will end up
|
/* Remember the current location for a function we will end up
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
2011-06-23 Jason Merrill <jason@redhat.com>
|
2011-06-23 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/49507
|
||||||
|
* g++.dg/cpp0x/defaulted30.C: New.
|
||||||
|
|
||||||
PR c++/49440
|
PR c++/49440
|
||||||
* g++.dg/rtti/anon-ns1.C: New.
|
* g++.dg/rtti/anon-ns1.C: New.
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue