+2018-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87476
+ * typeck2.c (digest_init_r): Re-add handing of signed/unsigned char
+ strings and add it to the initialization of wide array from non-wide
+ string diagnostics too.
+
2018-11-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88187
if (TYPE_PRECISION (typ1) == BITS_PER_UNIT)
{
- if (char_type != char_type_node)
+ if (char_type != char_type_node
+ && char_type != signed_char_type_node
+ && char_type != unsigned_char_type_node)
{
if (complain & tf_error)
error_at (loc, "char-array initialized from wide string");
}
else
{
- if (char_type == char_type_node)
+ if (char_type == char_type_node
+ || char_type == signed_char_type_node
+ || char_type == unsigned_char_type_node)
{
if (complain & tf_error)
error_at (loc,
2018-11-28 Jakub Jelinek <jakub@redhat.com>
+ PR c++/87476
+ * g++.dg/cpp0x/pr87476-1.C: New test.
+ * g++.dg/cpp0x/pr87476-2.C: New test.
+
PR c++/88215
* c-c++-common/ubsan/pr88215.c: New test.
--- /dev/null
+// PR c++/87476
+// { dg-do compile { target c++11 } }
+
+template <int>
+struct S {
+ void operator () () { constexpr unsigned char p[1] {}; }
+};
+
+void
+foo ()
+{
+ S<0>{} ();
+}
--- /dev/null
+// PR c++/87476
+// { dg-do compile { target c++11 } }
+
+void f0 () { constexpr char p[] = "11111"; }
+void f1 () { constexpr unsigned char p[] = "11111"; }
+void f2 () { constexpr signed char p[] = "11111"; }
+template <int N>
+void f3 () { constexpr char p[] = "11111"; }
+template <int N>
+void f4 () { constexpr unsigned char p[] = "11111"; }
+template <int N>
+void f5 () { constexpr signed char p[] = "11111"; }
+
+void
+baz ()
+{
+ f0 ();
+ f1 ();
+ f2 ();
+ f3<0> ();
+ f4<0> ();
+ f5<0> ();
+}