Commit f9b381b8 by Jason Merrill Committed by Jason Merrill

re PR c++/60409 ([c++1y] ICE on valid with template function)

	PR c++/60409
	* semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
	dependent expression.

From-SVN: r208352
parent 5d264d62
2014-03-05 Jason Merrill <jason@redhat.com> 2014-03-05 Jason Merrill <jason@redhat.com>
PR c++/60409
* semantics.c (force_paren_expr): Only add a PAREN_EXPR to a
dependent expression.
PR c++/60361 PR c++/60361
* parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID * parser.c (cp_parser_template_id): Don't set up a CPP_TEMPLATE_ID
if re-parsing might succeed. if re-parsing might succeed.
......
...@@ -1609,7 +1609,7 @@ force_paren_expr (tree expr) ...@@ -1609,7 +1609,7 @@ force_paren_expr (tree expr)
&& TREE_CODE (expr) != SCOPE_REF) && TREE_CODE (expr) != SCOPE_REF)
return expr; return expr;
if (processing_template_decl) if (type_dependent_expression_p (expr))
expr = build1 (PAREN_EXPR, TREE_TYPE (expr), expr); expr = build1 (PAREN_EXPR, TREE_TYPE (expr), expr);
else else
{ {
......
// PR c++/60409
// { dg-options -std=c++1y }
struct A
{
void foo();
};
template<typename T> void bar(T)
{
(A().foo)();
}
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