diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2715966e6f41ce0cc2cb32c05093fe27b71dc687..2b281c1672caefcdab857e32435aa68e5efa1ad7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2019-08-05  Jason Merrill  <jason@redhat.com>
+
+	* semantics.c (force_paren_expr): Preserve location.
+
 2019-08-02  Marek Polacek  <polacek@redhat.com>
 
 	PR c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 269092de1ef0b9e6decefc93b93b49e84c61c3dd..fc90c8d6f0ea2b371c5c95c6285052f39a3bd25c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1745,14 +1745,16 @@ force_paren_expr (tree expr)
       && TREE_CODE (expr) != SCOPE_REF)
     return expr;
 
+  location_t loc = cp_expr_location (expr);
+
   if (TREE_CODE (expr) == COMPONENT_REF
       || TREE_CODE (expr) == SCOPE_REF)
     REF_PARENTHESIZED_P (expr) = true;
   else if (processing_template_decl)
-    expr = build1 (PAREN_EXPR, TREE_TYPE (expr), expr);
+    expr = build1_loc (loc, PAREN_EXPR, TREE_TYPE (expr), expr);
   else
     {
-      expr = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (expr), expr);
+      expr = build1_loc (loc, VIEW_CONVERT_EXPR, TREE_TYPE (expr), expr);
       REF_PARENTHESIZED_P (expr) = true;
     }