Commit 0d8ab59c by Jason Merrill Committed by Jason Merrill

re PR c++/67064 (Register asm variable broken)

	PR c++/67064

	* semantics.c (force_paren_expr): Don't mess with hard register vars.

From-SVN: r229021
parent 620cf5ea
2015-10-19 Jason Merrill <jason@redhat.com> 2015-10-19 Jason Merrill <jason@redhat.com>
PR c++/67064
* semantics.c (force_paren_expr): Don't mess with hard register vars.
Implement N4268, Do constant evaluation of all non-type template args. Implement N4268, Do constant evaluation of all non-type template args.
* parser.c (cp_parser_template_argument): For C++1z just parse a * parser.c (cp_parser_template_argument): For C++1z just parse a
constant-expression. constant-expression.
......
...@@ -1660,6 +1660,8 @@ force_paren_expr (tree expr) ...@@ -1660,6 +1660,8 @@ force_paren_expr (tree expr)
REF_PARENTHESIZED_P (expr) = true; REF_PARENTHESIZED_P (expr) = true;
else if (type_dependent_expression_p (expr)) else if (type_dependent_expression_p (expr))
expr = build1 (PAREN_EXPR, TREE_TYPE (expr), expr); expr = build1 (PAREN_EXPR, TREE_TYPE (expr), expr);
else if (VAR_P (expr) && DECL_HARD_REGISTER (expr))
/* We can't bind a hard register variable to a reference. */;
else else
{ {
cp_lvalue_kind kind = lvalue_kind (expr); cp_lvalue_kind kind = lvalue_kind (expr);
......
// PR c++/67064
// { dg-options "-w" }
struct s {
int i;
};
register struct s *reg __asm__( "1" );
int f(void)
{
int i;
i = reg->i;
i = (reg)->i;
return 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