+2017-03-03 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79791
+ * typeck.c (string_conv_p): In C++11, always call pedwarn with
+ OPT_Wwrite_strings.
+
2017-03-02 Jason Merrill <jason@redhat.com>
Update overload resolution with deduction guides.
if (warn)
{
if (cxx_dialect >= cxx11)
- pedwarn (input_location,
- pedantic ? OPT_Wpedantic : OPT_Wwrite_strings,
+ pedwarn (input_location, OPT_Wwrite_strings,
"ISO C++ forbids converting a string constant to %qT",
totype);
else
+2017-03-03 Marek Polacek <polacek@redhat.com>
+
+ PR c++/79791
+ * g++.dg/warn/Wwrite-strings-1.C: New test.
+ * g++.dg/warn/Wwrite-strings-2.C: New test.
+ * g++.dg/warn/Wwrite-strings-3.C: New test.
+ * g++.dg/warn/Wwrite-strings-4.C: New test.
+ * g++.dg/warn/Wwrite-strings-5.C: New test.
+ * g++.dg/warn/Wwrite-strings-6.C: New test.
+ * g++.dg/warn/Wwrite-strings-7.C: New test.
+ * g++.dg/warn/Wwrite-strings-8.C: New test.
+ * g++.dg/warn/Wwrite-strings-9.C: New test.
+ * g++.dg/warn/Wwrite-strings-10.C: New test.
+ * g++.dg/warn/Wwrite-strings-11.C: New test.
+ * g++.dg/warn/Wwrite-strings-12.C: New test.
+
2017-03-03 Richard Biener <rguenther@suse.de>
PR middle-end/79818
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+char *s = "foo"; // { dg-warning "ISO C\\+\\+ forbids converting a string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target { ! c++11 } } }
+// { dg-options "" }
+
+char *s = "foo"; // { dg-warning "deprecated conversion from string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target { ! c++11 } } }
+// { dg-options "-pedantic-errors" }
+
+char *s = "foo"; // { dg-warning "deprecated conversion from string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target { ! c++11 } } }
+// { dg-options "-Werror=write-strings" }
+// { dg-message "some warnings being treated as errors" "" { target *-*-* } 0 }
+
+char *s = "foo"; // { dg-error "deprecated conversion from string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic-errors" }
+
+char *s = "foo"; // { dg-error "ISO C\\+\\+ forbids converting a string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic-errors -Wno-write-strings" }
+
+char *s = "foo";
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-Werror=write-strings" }
+// { dg-message "some warnings being treated as errors" "" { target *-*-* } 0 }
+
+char *s = "foo"; // { dg-error "ISO C\\+\\+ forbids converting a string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-Werror=write-strings -Wpedantic" }
+// { dg-message "some warnings being treated as errors" "" { target *-*-* } 0 }
+
+char *s = "foo"; // { dg-error "ISO C\\+\\+ forbids converting a string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-Werror=write-strings -Wno-pedantic" }
+// { dg-message "some warnings being treated as errors" "" { target *-*-* } 0 }
+
+char *s = "foo"; // { dg-error "ISO C\\+\\+ forbids converting a string constant" }
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wno-write-strings" }
+
+char *s = "foo";
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wpedantic -Wno-write-strings" }
+
+char *s = "foo";
--- /dev/null
+// PR c++/79791
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wno-error=write-strings -pedantic-errors" }
+
+char *s = "foo"; // { dg-warning "ISO C\\+\\+ forbids converting a string constant" }