aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 8a3e7fd..0cef867 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1647,17 +1647,10 @@ force_paren_expr (tree expr)
&& TREE_CODE (expr) != SCOPE_REF)
return expr;
- if (TREE_CODE (expr) == COMPONENT_REF)
+ if (TREE_CODE (expr) == COMPONENT_REF
+ || TREE_CODE (expr) == SCOPE_REF)
REF_PARENTHESIZED_P (expr) = true;
- else if (type_dependent_expression_p (expr)
- /* When processing_template_decl, a SCOPE_REF may actually be
- referring to a non-static data member of the current class, in
- which case its TREE_TYPE may not be properly cv-qualified (the
- cv-qualifiers of the implicit *this object haven't yet been taken
- into account) so we have to delay building a static_cast until
- instantiation. */
- || (processing_template_decl
- && TREE_CODE (expr) == SCOPE_REF))
+ else if (type_dependent_expression_p (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. */;