@@ -920,6 +920,7 @@ cp_genericize_init (tree *replace, tree from, tree to)
static void
cp_genericize_init_expr (tree *stmt_p)
{
+ iloc_sentinel ils = EXPR_LOCATION (*stmt_p);
tree to = TREE_OPERAND (*stmt_p, 0);
tree from = TREE_OPERAND (*stmt_p, 1);
if (SIMPLE_TARGET_EXPR_P (from)
@@ -935,6 +936,7 @@ cp_genericize_init_expr (tree *stmt_p)
static void
cp_genericize_target_expr (tree *stmt_p)
{
+ iloc_sentinel ils = EXPR_LOCATION (*stmt_p);
tree slot = TARGET_EXPR_SLOT (*stmt_p);
cp_genericize_init (&TARGET_EXPR_INITIAL (*stmt_p),
TARGET_EXPR_INITIAL (*stmt_p), slot);
new file mode 100644
@@ -0,0 +1,25 @@
+// PR c++/107154
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-gno-as-loc-support -dA" }
+// Test that we emit debug info exactly once for the last line.
+// { dg-final { scan-assembler-times {:25:1} 1 } }
+
+bool dummy;
+
+struct S {
+ const char *p;
+ S(const char *p): p(p) {}
+ ~S() { dummy = true; }
+};
+
+using Sar = S[];
+
+struct X {
+ X(Sar&&) { }
+};
+
+int main()
+{
+ X x(Sar{"", ""});
+ return 0;
+}