Commit d58a2b83 by Mark Mitchell Committed by Mark Mitchell

re PR c++/20679 (Parse error when accessing attributes of an inner class.…

re PR c++/20679 (Parse error when accessing attributes of an inner class. Enclosing class is template and have methods with the same name.)

	PR c++/20679
	* parser.c (cp_parser_template_name): Fix thinko.

	PR c++/20679
	* g++.dg/template/overload4.C: New test.

From-SVN: r97569
parent b89361c6
2005-04-04 Mark Mitchell <mark@codesourcery.com>
PR c++/20679
* parser.c (cp_parser_template_name): Fix thinko.
2005-04-04 Nathan Sidwell <nathan@codesourcery.com>
PR c++/20746
......
......@@ -8731,6 +8731,8 @@ cp_parser_template_name (cp_parser* parser,
;
else
{
tree fn = NULL_TREE;
/* The standard does not explicitly indicate whether a name that
names a set of overloaded declarations, some of which are
templates, is a template-name. However, such a name should
......@@ -8738,16 +8740,13 @@ cp_parser_template_name (cp_parser* parser,
template-id for the overloaded templates. */
fns = BASELINK_P (decl) ? BASELINK_FUNCTIONS (decl) : decl;
if (TREE_CODE (fns) == OVERLOAD)
{
tree fn;
for (fn = fns; fn; fn = OVL_NEXT (fn))
if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL)
break;
for (fn = fns; fn; fn = OVL_NEXT (fn))
if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL)
break;
}
else
if (!fn)
{
/* Otherwise, the name does not name a template. */
/* The name does not name a template. */
cp_parser_error (parser, "expected template-name");
return error_mark_node;
}
......
2005-04-04 Mark Mitchell <mark@codesourcery.com>
PR c++/20679
* g++.dg/template/overload4.C: New test.
2005-04-04 Nathan Sidwell <nathan@codesourcery.com>
PR c++/20746
......
// PR c++/20679
template <class T>
struct foo
{
struct bar
{
int m;
};
void m() const {}
void m() {}
bool n() const { return b->m < 42; }
bar *b;
};
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