Commit 67bcc252 by Mark Mitchell Committed by Mark Mitchell

re PR c++/17501 (Confusion with member templates)

	PR c++/17501
	* parser.c (cp_parser_nested_name_specifier): Do not resolve
	typename types if the user explicitly said "typename".

	PR c++/17501
	* g++.dg/template/typename7.C: New test.

From-SVN: r87616
parent 1800536a
2004-09-16 Mark Mitchell <mark@codesourcery.com>
PR c++/17501
* parser.c (cp_parser_nested_name_specifier): Do not resolve
typename types if the user explicitly said "typename".
2004-09-16 Andrew MacLeod <amacleod@redhat.com>
* error.c (dump_decl): Make sure there is lang_specific info before
......
......@@ -3497,7 +3497,9 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
look up names in "X<T>::I" in order to determine that "Y" is
a template. So, if we have a typename at this point, we make
an effort to look through it. */
if (is_declaration && parser->scope
if (is_declaration
&& !typename_keyword_p
&& parser->scope
&& TREE_CODE (parser->scope) == TYPENAME_TYPE)
parser->scope = resolve_typename_type (parser->scope,
/*only_current_p=*/false);
......
2004-09-16 Mark Mitchell <mark@codesourcery.com>
PR c++/17501
* g++.dg/template/typename7.C: New test.
2004-09-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* gcc.dg/tree-ssa/copy-headers.c: Update outcome.
......
// PR c++/17501
template<int> struct A;
template<> struct A<0>
{
struct B
{
struct C
{
typedef int D;
};
};
};
template<int I> struct E
{
typename A<I>::B::C::D i;
};
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