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
This commit is contained in:
parent
5d264d62dc
commit
f9b381b8eb
@ -1,5 +1,9 @@
|
|||||||
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)
|
|||||||
&& 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
|
||||||
{
|
{
|
||||||
|
12
gcc/testsuite/g++.dg/cpp1y/regress1.C
Normal file
12
gcc/testsuite/g++.dg/cpp1y/regress1.C
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// PR c++/60409
|
||||||
|
// { dg-options -std=c++1y }
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
void foo();
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T> void bar(T)
|
||||||
|
{
|
||||||
|
(A().foo)();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user