@@ -4908,10 +4908,9 @@ build_vec_init (tree base, tree maxindex, tree init,
/* Now make the result have the correct type. */
if (TREE_CODE (atype) == ARRAY_TYPE)
{
- atype = build_pointer_type (atype);
+ atype = build_reference_type (atype);
stmt_expr = build1 (NOP_EXPR, atype, stmt_expr);
- stmt_expr = cp_build_fold_indirect_ref (stmt_expr);
- suppress_warning (stmt_expr /* What warning? */);
+ stmt_expr = convert_from_reference (stmt_expr);
}
return stmt_expr;
new file mode 100644
@@ -0,0 +1,16 @@
+// PR c++/104702
+// { dg-additional-options "-fno-exceptions -Wunused-value" }
+
+struct FlyString {
+ FlyString(char const*);
+ ~FlyString();
+};
+
+struct Array { FlyString __data[1]; };
+
+void frobnicate(Array&);
+
+int main() {
+ Array s_reserved_words = { "" }; // { dg-bogus "value computed is not used" }
+ frobnicate(s_reserved_words);
+}