+1999-07-05 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template
+ parameters.
+ (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro.
+ * decl.c (push_class_binding): Use it.
+ (lookup_name_real): Likewise.
+
1999-07-02 Gavin Romig-Koch <gavin@cygnus.com>
* cp-tree.h (widest_integer_literal_type_node,
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
/* Nonzero if T is a class (or struct or union) type. Also nonzero
- for template type parameters and typename types. Despite its name,
+ for template type parameters, typename types, and instantiated
+ template template parameters. Despite its name,
this macro has nothing to do with the definition of aggregate given
in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */
#define IS_AGGR_TYPE(t) \
- (TREE_CODE (t) == TEMPLATE_TYPE_PARM \
- || TREE_CODE (t) == TYPENAME_TYPE \
+ (TREE_CODE (t) == TEMPLATE_TYPE_PARM \
+ || TREE_CODE (t) == TYPENAME_TYPE \
|| TREE_CODE (t) == TYPEOF_TYPE \
+ || (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM \
+ && TYPE_TEMPLATE_INFO (t)) \
|| TYPE_LANG_FLAG_5 (t))
/* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
#define IMPLICIT_TYPENAME_P(NODE) \
(TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
+/* Nonzero if NODE is a TYPE_DECL that should not be visible because
+ it is from a dependent base class. */
+#define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
+ (TREE_CODE (NODE) == TYPE_DECL \
+ && DECL_ARTIFICIAL (NODE) \
+ && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
+
/* Nonzero in INTEGER_CST means that this int is negative by dint of
using a twos-complement negated operand. */
#define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE))
context for an implicit typename declaration is always
the derived class in which the lookup was done, so the checks
based on the context of DECL below will not trigger. */
- if (TREE_CODE (decl) == TYPE_DECL
- && IMPLICIT_TYPENAME_P (TREE_TYPE (decl)))
+ if (IMPLICIT_TYPENAME_TYPE_DECL_P (decl))
INHERITED_VALUE_BINDING_P (binding) = 1;
else
{
binding = NULL_TREE;
if (binding
- && (!val || !(TREE_CODE (binding) == TYPE_DECL
- && IMPLICIT_TYPENAME_P (TREE_TYPE (binding)))))
+ && (!val || !IMPLICIT_TYPENAME_TYPE_DECL_P (binding)))
{
if (val_is_implicit_typename && !yylex)
warn_about_implicit_typename_lookup (val, binding);
val = binding;
val_is_implicit_typename
- = (TREE_CODE (val) == TYPE_DECL
- && IMPLICIT_TYPENAME_P (TREE_TYPE (val)));
+ = IMPLICIT_TYPENAME_TYPE_DECL_P (val);
if (!val_is_implicit_typename)
break;
}
};
template <template <typename> class C, typename T> foo<C,T>::foo(bar)
-{} // gets bogus error - C<T> not a class - XFAIL *-*-*
+{} // gets bogus error - C<T> not a class
// by Alexandre Oliva <oliva@dcc.unicamp.br>
// based on bug report by Nick Rasmussen <nick@jive.org>
-// crash test - XFAIL *-*-*
-
template <class T> struct foo;
template <class T> struct bar {
};
template <class T> struct baz {
- typedef bar<T>::foo foo; // ERROR - missing typename
+ typedef bar<T>::foo foo; // ERROR - missing typename - XFAIL *-*-*
void m(foo);
};
template <class T> struct baz {
typedef bar<T>::foo foo; // ERROR - implicit typename - XFAIL *-*-*
- void m(foo); // gets bogus error - dependent base class - XFAIL *-*-*
+ void m(foo);
};