+2018-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/83919
+ * typeck.c (convert_for_assignment): Suppress warn_ignored_qualifiers
+ for direct enum init.
+ * decl.c (reshape_init): Likewise.
+
2018-01-19 Marek Polacek <polacek@redhat.com>
* constexpr.c (fold_simple): Simplify.
if (check_narrowing (ENUM_UNDERLYING_TYPE (type), elt, complain))
{
warning_sentinel w (warn_useless_cast);
+ warning_sentinel w2 (warn_ignored_qualifiers);
return cp_build_c_cast (type, elt, tf_warning_or_error);
}
else
if (check_narrowing (ENUM_UNDERLYING_TYPE (type), elt, complain))
{
warning_sentinel w (warn_useless_cast);
+ warning_sentinel w2 (warn_ignored_qualifiers);
rhs = cp_build_c_cast (type, elt, complain);
}
else
+2018-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/83919
+ * g++.dg/cpp0x/pr83919.C: New test.
+
2018-01-19 Jeff Law <law@redhat.com>
Jakub Jelinek <jakub@redhat.com>
--- /dev/null
+// PR c++/83919
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wignored-qualifiers" }
+
+enum class Conf;
+struct foo
+{
+ foo (const Conf& conf) : x{conf} {} // { dg-bogus "type qualifiers ignored on cast result type" }
+ const Conf x;
+};