Commit d08a068b by Jason Merrill Committed by Jason Merrill

typeck.c (comp_template_parms_position): 'auto' and 'decltype(auto)' are…

typeck.c (comp_template_parms_position): 'auto' and 'decltype(auto)' are different from real template parms.

	* typeck.c (comp_template_parms_position): 'auto' and
	'decltype(auto)' are different from real template parms.

From-SVN: r208414
parent 94151520
2014-03-07 Jason Merrill <jason@redhat.com>
* typeck.c (comp_template_parms_position): 'auto' and
'decltype(auto)' are different from real template parms.
* parser.c (cp_parser_using_declaration): Consume the semicolon
after bare parameter pack error.
......
......@@ -1150,6 +1150,11 @@ comp_template_parms_position (tree t1, tree t2)
!= TEMPLATE_PARM_PARAMETER_PACK (index2)))
return false;
/* In C++14 we can end up comparing 'auto' to a normal template
parameter. Don't confuse them. */
if (cxx_dialect >= cxx1y && (is_auto (t1) || is_auto (t2)))
return TYPE_IDENTIFIER (t1) == TYPE_IDENTIFIER (t2);
return true;
}
......
......@@ -8,5 +8,5 @@ template<int> struct A
void foo()
{
A<0>().operator auto(); // { dg-error "auto.*conversion" }
A<0>().operator auto(); // { dg-error "auto" }
}
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