* pt.c (lookup_template_class): Handle when current_class_type
is a local class.
* g++.dg/template/crash21.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72643
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-10-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12495
+ * pt.c (lookup_template_class): Handle when current_class_type
+ is a local class.
+
2003-10-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/2513
tree ctx;
for (ctx = current_class_type;
- ctx;
- ctx = TYPE_CONTEXT (ctx))
- {
- if (TREE_CODE (ctx) == NAMESPACE_DECL)
- break;
- if (same_type_p (ctx, template_type))
- goto found_ctx;
- }
+ ctx && TREE_CODE (ctx) != NAMESPACE_DECL;
+ ctx = (TYPE_P (ctx)
+ ? TYPE_CONTEXT (ctx)
+ : DECL_CONTEXT (ctx)))
+ if (TYPE_P (ctx) && same_type_p (ctx, template_type))
+ goto found_ctx;
/* We're not in the scope of the class, so the
TEMPLATE_TYPE is not the type we want after all. */
+2003-10-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12495
+ * g++.dg/template/crash21.C: New test.
+
2003-10-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/2513
--- /dev/null
+// { dg-do compile }
+
+// Origin: rmerkert@alphatech.com
+// Volker Reichelt <reichelt@gcc.gnu.org>
+
+// PR c++/12495: ICE looking up class template in local class.
+
+template <typename> struct A {};
+
+template <typename T> void foo()
+{
+ struct B
+ {
+ B (const A<T>&);
+ };
+}