From: paolo Date: Wed, 15 Aug 2007 09:06:42 +0000 (+0000) Subject: /cp X-Git-Tag: upstream/4.9.2~46896 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bea21dbe53764aae7587a534c160786a7cfabdd;p=platform%2Fupstream%2Flinaro-gcc.git /cp 2007-08-15 Paolo Carlini PR c++/33035 * pt.c (push_template_decl_real): Depending on TYPE_P use either TYPE_CONTEXT or DECL_CONTEXT. /testsuite 2007-08-15 Paolo Carlini PR c++/33035 * g++.dg/template/crash68.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127508 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e632aac..892e8a6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-15 Paolo Carlini + + PR c++/33035 + * pt.c (push_template_decl_real): Depending on TYPE_P + use either TYPE_CONTEXT or DECL_CONTEXT. + 2007-08-14 Mark Mitchell * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5a0bd71..f414bc3 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3913,7 +3913,9 @@ push_template_decl_real (tree decl, bool is_friend) if (current == decl) current = ctx; else - current = TYPE_CONTEXT (current); + current = (TYPE_P (current) + ? TYPE_CONTEXT (current) + : DECL_CONTEXT (current)); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e531de..eef5e69 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-15 Paolo Carlini + + PR c++/33035 + * g++.dg/template/crash68.C: New. + 2007-08-15 Maxim Kuvyrkov * gcc.dg/sibcall-3.c: Remove m68k from XFAIL list. diff --git a/gcc/testsuite/g++.dg/template/crash68.C b/gcc/testsuite/g++.dg/template/crash68.C new file mode 100644 index 0000000..9171f8c --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash68.C @@ -0,0 +1,16 @@ +// PR c++/33035 + +template +struct a { + template + struct b { + template + void f() + { + struct g + { + ~g() {} + }; + } + }; +};