+2008-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/33959
+ * pt.c (tsubst_aggr_type): Make sure our context is complete.
+
2008-01-02 Volker Reichelt <reichelt@netcologne.de>
Backport:
up. */
context = TYPE_CONTEXT (t);
if (context)
- context = tsubst_aggr_type (context, args, complain,
- in_decl, /*entering_scope=*/1);
+ {
+ context = tsubst_aggr_type (context, args, complain,
+ in_decl, /*entering_scope=*/1);
+ /* If context is a nested class inside a class template,
+ it may still need to be instantiated (c++/33959). */
+ complete_type (context);
+ }
/* Then, figure out what arguments are appropriate for the
type we are trying to find. For example, given:
--- /dev/null
+// PR c++/33959
+
+template <typename T> struct A
+{
+ struct C
+ {
+ template <typename U> struct D {};
+ };
+ template <typename S> static C::D<S> bar (S const &);
+};
+
+struct E {};
+
+int
+main ()
+{
+ E e;
+ A<E>::bar (e);
+}