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: r185443
This commit is contained in:
Jason Merrill 2012-03-15 17:22:38 -04:00 committed by Jason Merrill
parent 6715d47bba
commit 92caa91a0d
4 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-03-15 Jason Merrill <jason@redhat.com>
PR c++/52582
* method.c (implicitly_declare_fn): Set DECL_EXTERNAL.
2012-03-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/44783

View File

@ -1593,6 +1593,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-15 Jason Merrill <jason@redhat.com>
* g++.dg/torture/pr52582.C: New.
2012-03-15 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* lib/fortran-modules.exp: New file which was forgotten in r185430.

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 ();
}