Commit 28267cfc by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/34336 (4.2.2 internal error in stabilize_expr)

	PR c++/34336
	* tree.c (stabilize_call, stabilize_init): Do nothing if
	processing_template_decl.

	* g++.dg/template/new8.C: New test.

From-SVN: r130645
parent 0bf0efd5
2007-12-06 Jakub Jelinek <jakub@redhat.com>
PR c++/34336
* tree.c (stabilize_call, stabilize_init): Do nothing if
processing_template_decl.
2007-12-05 Jakub Jelinek <jakub@redhat.com> 2007-12-05 Jakub Jelinek <jakub@redhat.com>
PR c++/34271 PR c++/34271
......
...@@ -2602,8 +2602,11 @@ stabilize_call (tree call, tree *initp) ...@@ -2602,8 +2602,11 @@ stabilize_call (tree call, tree *initp)
int i; int i;
int nargs = call_expr_nargs (call); int nargs = call_expr_nargs (call);
if (call == error_mark_node) if (call == error_mark_node || processing_template_decl)
return; {
*initp = NULL_TREE;
return;
}
gcc_assert (TREE_CODE (call) == CALL_EXPR); gcc_assert (TREE_CODE (call) == CALL_EXPR);
...@@ -2662,7 +2665,7 @@ stabilize_init (tree init, tree *initp) ...@@ -2662,7 +2665,7 @@ stabilize_init (tree init, tree *initp)
*initp = NULL_TREE; *initp = NULL_TREE;
if (t == error_mark_node) if (t == error_mark_node || processing_template_decl)
return true; return true;
if (TREE_CODE (t) == INIT_EXPR if (TREE_CODE (t) == INIT_EXPR
......
2007-12-06 Jakub Jelinek <jakub@redhat.com>
PR c++/34336
* g++.dg/template/new8.C: New test.
2007-12-06 Tobias Burnus <burnus@net-b.de> 2007-12-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34333 PR fortran/34333
// PR c++/34336
// { dg-do compile }
struct A;
template <class T>
struct S
{
T *m;
T &operator* () { return *m; }
};
struct B
{
B (const A &);
};
template <class T>
struct C
{
C ();
S<A> c;
};
template <class T>
C<T>::C ()
{
B *b = new B (*c);
}
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