Commit fbd4ef4c by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/21151 (ICE when compiling c++ PCH of class definition within template function.)

cp:
	PR c++/21151
	* name-lookup.c (pushtag): Push local class even in a template.
testsuite:
	PR c++/21151
	* g++.dg/pch/local-1.C: New.
	* g++.dg/pch/local-1.Hs: New.

From-SVN: r100482
parent bf8f8254
2005-06-02 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21151
* name-lookup.c (pushtag): Push local class even in a template.
2005-05-31 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21165
......
......@@ -4698,8 +4698,7 @@ pushtag (tree name, tree type, tag_scope scope)
way. (It's otherwise tricky to find a member function definition
it's only pointed to from within a local class.) */
if (TYPE_CONTEXT (type)
&& TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL
&& !processing_template_decl)
&& TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL)
VEC_safe_push (tree, gc, local_classes, type);
}
if (b->kind == sk_class
......
2005-06-02 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21151
* g++.dg/pch/local-1.C: New.
* g++.dg/pch/local-1.Hs: New.
2005-06-01 Diego Novillo <dnovillo@redhat.com>
PR 14341, PR 21332, PR 20701, PR 21086, PR 21090
......
#include "local-1.H"
int main()
{
func<int> ();
return 0;
}
template<typename T> void func()
{
struct object
{
object() {}
};
}
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