re PR c++/52582 (g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit))

PR c++/52582
	* method.c (implicitly_declare_fn): Set DECL_EXTERNAL.

From-SVN: r185705
This commit is contained in:
Jason Merrill 2012-03-22 14:34:24 -04:00 committed by Jason Merrill
parent a896a0dbc1
commit 1d37e85568
4 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-03-22 Jason Merrill <jason@redhat.com>
PR c++/52582
* method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
2012-03-22 Jakub Jelinek <jakub@redhat.com>
Backported from mainline

View File

@ -1590,6 +1590,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
DECL_DELETED_FN (fn) = deleted_p;
DECL_DECLARED_CONSTEXPR_P (fn) = constexpr_p;
}
DECL_EXTERNAL (fn) = true;
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
gcc_assert (!TREE_USED (fn));

View File

@ -1,3 +1,7 @@
2012-03-22 Jason Merrill <jason@redhat.com>
* g++.dg/torture/pr52582.C: New.
2012-03-22 Georg-Johann Lay <avr@gjlay.de>
Backport from 2012-03-20 mainline r185583.

View File

@ -0,0 +1,23 @@
// PR c++/52582
inline void *operator new (__SIZE_TYPE__, void *p) throw ()
{
return p;
}
struct B
{
virtual ~B ();
B ();
};
struct A : B
{
A () : B () {}
virtual void bar ();
};
void
foo ()
{
char a[64];
B *b = new (&a) A ();
b->~B ();
}