Commit ad810b22 by Mark Mitchell Committed by Mark Mitchell

* decl.c (make_typename_type): Tighten error-checking.

From-SVN: r26586
parent c9eb638e
1999-04-22 Mark Mitchell <mark@codesourcery.com>
* decl.c (make_typename_type): Tighten error-checking.
1999-04-20 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (build_binary_op): Remove unneeded parameter.
......
......@@ -5385,19 +5385,20 @@ make_typename_type (context, name)
{
if (TREE_CODE (fullname) == TEMPLATE_ID_EXPR)
{
tree tmpl = NULL_TREE;
if (IS_AGGR_TYPE (context))
t = lookup_field (context, name, 0, 0);
else
tmpl = lookup_field (context, name, 0, 0);
if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
{
cp_error ("no class template named `%#T' in `%#T'",
name, context);
return error_mark_node;
}
if (t && DECL_CLASS_TEMPLATE_P (t))
return lookup_template_class (t, TREE_OPERAND (fullname, 1),
NULL_TREE, context,
/*entering_scope=*/0);
return lookup_template_class (tmpl,
TREE_OPERAND (fullname, 1),
NULL_TREE, context,
/*entering_scope=*/0);
}
else
{
......
// Build don't link:
// Origin: Mark Mitchell <mark@codesourcery.com>
template <class T>
struct S {
typedef typename T::Y<T>::Z X; // ERROR - No Y in A
X x; // ERROR - No Y in A
};
struct A {
struct Y {
typedef A Z;
};
};
template struct S<A>;
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